-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Description
Describe the bug
When I create a alb fargate construct as the following
const fargate = new ApplicationLoadBalancedFargateService(this, 'fargate', { cluster, publicLoadBalancer: true, memoryLimitMiB: 1024, cpu: 512, desiredCount: 1, circuitBreaker: { rollback: true, }, taskImageOptions: { image: ContainerImage.fromRegistry('nginx'), containerName: 'pdp', containerPort: 7000, enableLogging: true, environment: { ENVIRONMENT_ONE: process.env.environmentOne, }, }, })
It will create cloudformation that looks correct, however, the stack doesn't look to honor the configured cpu, memoryLimitMiB and the environment.
When I went to use a the secrets property in typescript it is typed with values being Secret.
When creating a new Secret and passing in as a value, I get a type error signifying that Secret is missing the property 'arn'.
when looking up a Secret you get back a type ISecret, so I don't see a way that this is used.
Regression Issue
- Select this option if this issue appears to be a regression.
Last Known Working CDK Version
No response
Expected Behavior
I would expect environment to be passed to my fargate task def.
Current Behavior
environment is showing up as an empty array.
Reproduction Steps
Using typescript, create a ALB fargate service with a simple docker image from the registry and place environment variables per the props.
After this synth's correctly, see that the deployed task def doesn't include the properties in the environments array.
Try to use this construct while defining secrets.
Possible Solution
Secrets should be able to be defined from ISecret using the latest Secret.fromSecretNameV2 method on the Secret construct.
Additional Information/Context
No response
CDK CLI Version
2.1006.0 (build a3b9762)
Framework Version
2.1006.0
Node.js Version
22.12.0
OS
Linux 24.04.2 LTS
Language
TypeScript
Language Version
5.8.2
Other information
No response