Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(aws-codebuild): Pipeline build fails when environment variable is from parameter store #11769

Closed
cvrajeesh opened this issue Nov 29, 2020 · 1 comment · Fixed by #11770
Closed
Assignees
Labels
@aws-cdk/aws-codebuild Related to AWS CodeBuild bug This issue is a bug. effort/small Small work item – less than a day of effort in-progress This issue is being actively worked on. p1

Comments

@cvrajeesh
Copy link
Contributor

cvrajeesh commented Nov 29, 2020

Pipeline build fails when an environment variable is loaded from parameter store.

Reproduction Steps

new PipelineProject(this, "PackageBuild", {
      buildSpec: BuildSpec.fromObject({
        .....
        phases: {
          install: {
            commands: "yarn install",
          },
          build: {
            commands: ["yarn build"],
          },
          post_build: {
            commands: ["yarn test"],
          },
        },
        artifacts: {
        ......
        },
      }),
      environment: {
       .....
      },
      environmentVariables: {
        MY_ENV: {
          type: BuildEnvironmentVariableType.PARAMETER_STORE,
          value: "/prams/param1",
        },
      },
    });

What did you expect to happen?

Build to succeed

What actually happened?

Build failed and the log shows the following lines, nothing after that

[Container] 2020/11/29 10:14:46 YAML location is /codebuild/readonly/buildspec.yml
[Container] 2020/11/29 10:14:46 Processing environment variables
[Container] 2020/11/29 10:14:46 Decrypting parameter store environment variables

Environment

  • CDK CLI Version : 1.75.0
  • Framework Version:
  • Node.js Version: 12.13.0
  • OS : macOS
  • Language (Version): TypeScript (4.0.3)

Other

It looks like generated CodePipeline role policy doesn't contain a policy for ssm:GetParameters


This is 🐛 Bug Report

@cvrajeesh cvrajeesh added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Nov 29, 2020
@github-actions github-actions bot added the @aws-cdk/aws-codebuild Related to AWS CodeBuild label Nov 29, 2020
@skinny85 skinny85 added effort/small Small work item – less than a day of effort in-progress This issue is being actively worked on. p1 and removed needs-triage This issue or PR still needs to be triaged. labels Nov 30, 2020
@mergify mergify bot closed this as completed in #11770 Nov 30, 2020
mergify bot pushed a commit that referenced this issue Nov 30, 2020
…ronment variables (#11770)

Pipeline build fails when the environment variable is loaded from SSM Parameter Store.

Closes #11769

---------------

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-codebuild Related to AWS CodeBuild bug This issue is a bug. effort/small Small work item – less than a day of effort in-progress This issue is being actively worked on. p1
Projects
None yet
2 participants