aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
https://aws.amazon.com/cdk
Apache License 2.0
11.68k stars 3.93k forks source link

aws-apprunner-alpha: environmentSecrets are not update #28103

Closed cjoecker closed 12 months ago

cjoecker commented 12 months ago

Describe the bug

I have an app deployed like this:

    const service = new Service(scope, "service", {
        serviceName: "WebApp",
        instanceRole,
        cpu: Cpu.ONE_VCPU,
        memory: Memory.TWO_GB,
        accessRole,
        source: Source.fromAsset({
            imageConfiguration: {
                port: 3000,
                environmentVariables: checkedEnvVariables,
                environmentSecrets: {
                    SECRET: Secret.fromSecretsManager(secret),
                },
            },
            asset: dockerImageAsset,
        }),
        vpcConnector,
    });

Once it is deployed, if I add another secret like this, the secret are not updated:

    const service = new Service(scope, "service", {
        serviceName: "WebApp",
        instanceRole,
        cpu: Cpu.ONE_VCPU,
        memory: Memory.TWO_GB,
        accessRole,
        source: Source.fromAsset({
            imageConfiguration: {
                port: 3000,
                environmentVariables: checkedEnvVariables,
                environmentSecrets: {
                    SECRET: Secret.fromSecretsManager(secret),
                    SECRET2: Secret.fromSecretsManager(secret2),  // this is new
                },
            },
            asset: dockerImageAsset,
        }),
        vpcConnector,
    });

As a workaround, I have service.addSecret that is working to add new secrets

Expected Behavior

Secrets are updated when they are added to environmentSecrets object

Current Behavior

Secrets are NOT updated when they are added to environmentSecrets object

Reproduction Steps

See bug description

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.110.1 (build 0d37f0d)

Framework Version

"@aws-cdk/aws-apprunner-alpha": "^2.110.1-alpha.0" , "aws-cdk-lib": "^2.110.1",

Node.js Version

18.16.0

OS

MacOS

Language

TypeScript

Language Version

No response

Other information

No response

github-actions[bot] commented 12 months ago

⚠️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.