cdk-pipelines-github icon indicating copy to clipboard operation
cdk-pipelines-github copied to clipboard

JobStep 'with' keyword causing syntax errors - Python

Open cullancarey opened this issue 2 years ago • 1 comments

Hey everyone, I am attempting to use cdk-pipelines-github and I believe I found an issue. I am trying to define a step within a job, and one of the property keys is ‘with,’ a Python keyword causing syntax errors in this context. Here is the documentation showing such. Job Step documentation

Below is the specific code block where I am trying to configure AWS credentials using the CDK pipelines GitHub constructs

cdk_pipelines_github.JobStep(
     name = f"Configure AWS Credentials FOR {environment}",
     uses = "aws-actions/configure-aws-credentials@v2",
     with = {"role-to-assume": f"arn:aws:iam::{account}:role/{deployment_role}",
     "role-session-name": f"cdk-deployment-{region}-{account}",
     "aws-region": region},
)

Here is the code block with the GitHub Action step I am trying to replicate above.

# Configure AWS Creds
      - name: Configure AWS Credentials ${{ inputs.environment }}
        uses: aws-actions/configure-aws-credentials@v2
        with:
          role-to-assume: arn:aws:iam::${{ vars.ACCOUNT_ID }}:role/CDKDeploymentRole-${{ vars.REGION }}-${{ vars.ACCOUNT_ID }}
          role-session-name: cdk-deployment-${{ vars.REGION }}-${{ vars.ACCOUNT_ID }}
          aws-region: ${{ vars.REGION }}
  • A reproducible test case or series of steps

    • Try and configure a job step that requires use of the 'with' keyword like my example above. This would also be needed for any reusable workflow the requires inputs.
  • The version of our code being used

    • v0.4.72
  • Any modifications you've made relevant to the bug

    • None
  • Anything unusual about your environment or deployment

    • I don't believe anything about the environment would be causing this issue. I can think of nothing out of the ordinary with our environment.

cullancarey avatar Jun 01 '23 11:06 cullancarey