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-batch-alpha: Parameter Store secrets not supported in new version #26339

Closed
jacob-swanson opened this issue Jul 12, 2023 · 3 comments · Fixed by #26373
Closed

aws-batch-alpha: Parameter Store secrets not supported in new version #26339

jacob-swanson opened this issue Jul 12, 2023 · 3 comments · Fixed by #26373
Assignees
Labels
@aws-cdk/aws-batch Related to AWS Batch bug This issue is a bug. effort/small Small work item – less than a day of effort p1

Comments

@jacob-swanson
Copy link

Describe the bug

The older version of aws-batch-alpha allowed for secrets to be defined using either Secrets Manager or Parameter Store.

In the old JobDefinition construct, secrets was defined as:

readonly secrets?: {
    [key: string]: ecs.Secret;
};

Which works with either Secrets Manager or Parameter Store.

But the new EcsContainerDefinitionProps defines secrets as

readonly secrets?: {
    [envVarName: string]: secretsmanager.ISecret;
};

Which is just Secrets Manager.

Expected Behavior

I should be able to create a job definition using secrets from either Secrets Manager or Parameter Store.

Current Behavior

Job definitions cannot use secrets from parameter store.

Reproduction Steps

Snippet of old, working code:

new batch.JobDefinition(this, "JobDefinition", {
    container: {
        secrets: {
            ENVAR_NAME: ecs.Secret.fromSsmParameter(ssm.StringParameter.fromStringParameterName(this, "StringParameter", "stringParameterName"))
        }
    }
})

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.87.0 (build 9fca790)

Framework Version

No response

Node.js Version

v18.16.1

OS

Pop!_OS 22.04 LTS

Language

Typescript

Language Version

No response

Other information

No response

@jacob-swanson jacob-swanson added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jul 12, 2023
@github-actions github-actions bot added the @aws-cdk/aws-batch Related to AWS Batch label Jul 12, 2023
@peterwoodworth
Copy link
Contributor

Yep, looks like this is the case. @comcalvi something to take a look at, not sure how you would like to go about this.

@peterwoodworth peterwoodworth added p1 effort/small Small work item – less than a day of effort and removed needs-triage This issue or PR still needs to be triaged. labels Jul 12, 2023
@comcalvi
Copy link
Contributor

ah, I missed that it could also be parameter store

@mergify mergify bot closed this as completed in #26373 Jul 18, 2023
mergify bot pushed a commit that referenced this issue Jul 18, 2023
…6373)

ECS Containers can take both Secrets Manager Secrets and SSM parameters. Currently, only Secrets manager is supported.

Closes #26339.

----

*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.

bmoffatt pushed a commit to bmoffatt/aws-cdk that referenced this issue Jul 29, 2023
…s#26373)

ECS Containers can take both Secrets Manager Secrets and SSM parameters. Currently, only Secrets manager is supported.

Closes aws#26339.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-batch Related to AWS Batch bug This issue is a bug. effort/small Small work item – less than a day of effort p1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants