-
Notifications
You must be signed in to change notification settings - Fork 4k
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
(ECS.LogsDrivers): Resolution error when using ecs.LogDrivers.firelens secretOptions #28279
Comments
I just tried the code below and I can successfully synth and deploy with no errors. export class Demo extends DemoStack {
constructor(scope: Construct, id: string, props: StackProps) {
super(scope, id, props);
const task = new ecs.Ec2TaskDefinition(this, 'Task');
const dataDogApiKeySecret = secretsmanager.Secret.fromSecretNameV2(this, 'DataDogApiKeySecret', 'dummyName');
task.addContainer('Server', {
image: ecs.ContainerImage.fromRegistry('nginx'),
memoryLimitMiB: 512,
cpu: 1,
logging: ecs.LogDrivers.firelens({
options: {
Name: 'firehose',
region: 'us-east-1',
delivery_stream: 'my-stream',
},
secretOptions: {
apikey: ecs.Secret.fromSecretsManager(dataDogApiKeySecret)
}
})
});
}
} As I can't see your full code, I am not sure if it's a bug but it works to me with the code above. Can you simplify your code and see if it works with the latest cdk release? |
This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
I was playing with simplifying things yesterday. Once I narrow it down to exactly what's causing the issue I will share a snippet. Thanks for your help on this! |
This was absolutely my bad. I had If you do that (like the snippet below) you get that really confusing Resolution Error.
|
|
Describe the bug
I get a Resolution Error when trying to synthesize `
Expected Behavior
If I retrieve my Datadog API Key secret and attempt to use secretOptions like the simplified snippet below I get
Resolution error: Trying to resolve a non-data object. Only token are supported for lazy evaluation
.Current Behavior
Error: Resolution error: Resolution error: Resolution error: Trying to resolve a non-data object. Only token are supported for lazy evaluation. Path: /Resources/${Token[DeltaServerStack.DeltaServer.TaskDefinition.Resource.LogicalID.498]}/Properties/containerDefinitions/2/logConfiguration/options/secretOptions/apikey/grantRead. Object: grantee=>secret.grantRead(grantee).
Reproduction Steps
See snippet above... Just running cdk synth or cdk deploy gives the error
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.114.1
Framework Version
No response
Node.js Version
v20.7.0
OS
MAC 13.4.1
Language
TypeScript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: