question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SAM pipeline removed after deploy

See original GitHub issue

Description:

I’m using the hello world template with python 3.8 to test the “sam pipeline bootstrap” feature.

I’m executing sam deploy -t codepipeline.yaml --stack-name sam-desarrollo --capabilities=CAPABILITY_IAM

In order to deploy the pipeline. It fails in my case due the github connection.

After update GitHub connector and retry the pipeline, it start normally but in some point, the pipeline itself is deleted.

Steps to reproduce:

sam init select python 3.8 and hello world proyect. sam pipeline init --bootstrap Select AWS Pipeline as CI/CD, github as git provider. sam deploy -t codepipeline.yaml --stack-name myStack --capabilities=CAPABILITY_IAM

At this point the pipeline will fail. Update the pending conection for github.

Push the generated pipeline files to git, it will trigger the pipeline.

The pipeline start normally but at some point, is removed.

Observed result:

Cloud trail show a DeletePipeline event.

{
    "eventVersion": "1.08",
    "userIdentity": {
        "type": "AssumedRole",
        "principalId": "xxxx:AWSCloudFormation",
        "arn": "arn:aws:sts::xxxx:assumed-role/aws-sam-cli-managed-dev-p-CloudFormationExecutionR-5524JO8QQ6S9/AWSCloudFormation",
        "accountId": "xxxx",
        "invokedBy": "cloudformation.amazonaws.com"
    },
    "eventTime": "2022-03-16T18:01:26Z",
    "eventSource": "codepipeline.amazonaws.com",
    "eventName": "DeletePipeline",
    "requestParameters": {
        "name": "MyStack-Pipeline-11AZSNLODS7NX"
    },
}

Expected result:

Keep pipeline, I have no idea why is removed.

Additional environment details (Ex: Windows, Mac, Amazon Linux etc)

SAM CLI, version 1.40.0

Add --debug flag to any SAM CLI commands you are running

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
bogdan-romanivcommented, Oct 26, 2022

Thanks, @dorlanpabon. It’s what you said. Don’t set the same stack name as your SAM application because doing so will overwrite your application’s stack (and delete your application resources).

1reaction
dorlanpaboncommented, Oct 26, 2022

Compañeros, hay algo que pude evidencia un tiempo, el nombre del stage que se pide en el sam deploy, no puede ser el mismo que los stage creados, pues eso es lo que ocasiona la sobrescritura y eliminación de la pila

Read more comments on GitHub >

github_iconTop Results From Across the Web

sam pipeline bootstrap - AWS Serverless Application Model
This command generates the required AWS infrastructure resources to connect to your CI/CD system. This step must be run for each deployment stage...
Read more >
AWS SAM deploy command with `sam pipeline init` failed to ...
After trying to understand the whole logic of the deploy command and their internals, I have managed to retain the CodePipeline in AWS ......
Read more >
A Serverless CI/CD Pipeline for SAM applications - Scratchpad
Furthermore, if no errors occur during build, unit testing, deployment and integration testing the code can be deployed to the next environment after...
Read more >
Tutorial: Deploying a Hello World application - 亚马逊云科技
Installing the Amazon Serverless Application Model Command Line Interface (Amazon SAM CLI). Note: Make sure that you have version 1.13.0 or later.
Read more >
A Practical Guide to Surviving AWS SAM | Claranet Italia
The release pipeline for SAM build, package and deploy is really easy. ... always delete in the order of the SAM stack and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found