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

JobStep 'with' keyword causing syntax errors - Python #622

Open
cullancarey opened this issue Jun 1, 2023 · 1 comment
Open

JobStep 'with' keyword causing syntax errors - Python #622

cullancarey opened this issue Jun 1, 2023 · 1 comment

Comments

@cullancarey
Copy link

cullancarey commented Jun 1, 2023

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.
@Alexerson
Copy link

You can use the parameter with_=, rather than with= and it will work fine. But the documentation should reflect that indeed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants