cdklabs / cdklabs/cdk-pipelines-github

JobStep 'with' keyword causing syntax errors - Python

Open
#622 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
384
Forks
45
Avg merge
1d 1h
Merged PRs (30d)
4

Description

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](https://constructs.dev/packages/cdk-pipelines-github/v/0.4.72/api/JobStep?lang=python)

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

```python
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.

```yaml
# 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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.