By using AWS re:Post, you agree to the Terms of Use

Unanswered Questions tagged with AWS CodePipeline

Sort by most recent

Browse through the questions and answers listed below or filter and sort to narrow down your results.

CodeBuild Bug? AWS CLI broken on AL2/aarch64 env, error "pyenv: version `3.9.7' is not installed"

## Summary: On CodeBuild projects running on AL2/aarch64, running the `aws` CLI command (any command works, I use `--version` as a sanity check) yields the following error: ``` [Container] 2022/09/10 02:39:37 Running command aws --version pyenv: version `3.9.7' is not installed (set by /codebuild/output/src576940877/src/.python-version) ``` The process exits with status code 1 and the build terminates. I can reproduce the error exactly on my M1 MBP running locally, following the instructions for local agent usage [here](https://docs.aws.amazon.com/codebuild/latest/userguide/use-codebuild-agent.html). ## Steps to Reproduce 1. Create minimal buildspec.yml: ```yml version: 0.2 phases: build: commands: - aws --version ``` 2. Launch on CodeBuild project set to AL2/aarch64, on SMALL size build. ## Expected behavior Build should pass. Output of command should be: ``` [Container] 2022/09/10 03:00:41 Running command /usr/local/bin/aws --version aws-cli/2.7.31 Python/3.9.11 Linux/5.10.104-linuxkit exe/aarch64.amzn.2 prompt/off ``` ## Actual behavior Output is actually: ``` [Container] 2022/09/10 02:39:37 Running command aws --version pyenv: version `3.9.7' is not installed (set by /codebuild/output/src576940877/src/.python-version) ``` ## Workaround The AWS CLI can be installed manually and run via direct path: ``` version: 0.2 phases: install: runtime-versions: python: 3.9 commands: - curl "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip" -o "awscliv2.zip" - unzip awscliv2.zip - ./aws/install build: commands: - /usr/local/bin/aws --version ``` This produces the expected output and the build succeeds.
0
answers
0
votes
20
views
asked 15 days ago

Unable to Add CodeStarNotification to CodePipeline with properly configured SNS access policy

Currently facing an issue with creating a notification rule for code pipeline using CDK with Pipeline or CodePipeline constructs ``` Resource handler returned message: "Invalid request provided: AWS::CodeStarNotifications::NotificationRule" (RequestToken: <GUID>, HandlerErrorCode: InvalidRequest) ``` The topic and chatbot are already defined in a different stack. The topic already has configured an access policy. However when I attempt to create a rule for my pipelines, it fails. Every time. ``` { "Version": "2008-10-17", "Statement": [ { "Sid": "AWSCodeStarNotifications_publish", "Effect": "Allow", "Principal": { "Service": "codestar-notifications.amazonaws.com" }, "Action": "SNS:Publish", "Resource": "arn:aws:sns:us-east-1:123456789:PipelineNotifications" } ] } ``` Referencing topic: ``` const pipelineNotificationsTopic = sns.Topic.fromTopicArn( this, "PipelineNotifications", `arn:aws:sns:${props?.env.region}:${props?.env.account}:PipelineNotifications ` ); ``` Pipeline code: ``` this.pipeline = new Pipeline( this, `${props?.appName}-MyPipeline`, { pipelineName: "MyPipeline", crossAccountKeys: true, restartExecutionOnUpdate: true, } ); const rule = this.pipeline.notifyOn( "CodeStarRule", pipelineNotificationsTopic, { events: [ PipelineNotificationEvents.PIPELINE_EXECUTION_SUCCEEDED, PipelineNotificationEvents.PIPELINE_EXECUTION_FAILED, PipelineNotificationEvents.ACTION_EXECUTION_FAILED, ], detailType: DetailType.FULL, } ); ``` or ``` this.pipeline = new Pipeline( this, `${props?.appName}-MyPipeline`, { pipelineName: "MyPipeline", crossAccountKeys: true, restartExecutionOnUpdate: true, } ); const rule =new NotificationRule(this, "Notification", { detailType: DetailType.FULL, events: [ "codepipeline-pipeline-pipeline-execution-failed", "codepipeline-pipeline-action-execution-failed", "codepipeline-pipeline-stage-execution-failed", "codepipeline-pipeline-manual-approval-failed", "codepipeline-pipeline-manual-approval-needed", ], source: pipeline, targets: [pipelineNotificationsTopic], }); ```
0
answers
0
votes
30
views
asked 2 months ago