Unable to extract the values using cdk synth command for Fn.importValue
See original GitHub issueGeneral Issue
Fn.importValue unable to fetch the value and still returning Tokens
The Question
Hi Team,
I have an implementation where i need to fetch the existing ECS Cluster details. I have the import values from the VPC and Security Group of another base stack. However, While using the Fn.importValue i am getting an error :
All arguments to look up a security group must be concrete (no Tokens)
Here is my source code
ecs.Cluster.fromClusterAttributes(this, 'existing', { clusterName: Fn.importValue(${propsBackend.clusterName}-ExistingClusterStackName), vpc: vpc, securityGroups: [ ec2.SecurityGroup.fromLookup( this, 'ECSInstanceSecurityGroup', Fn.importValue(${propsBackend.clusterName}-ExistingClusterSecurityGroup), ), ], });
Whenever i run the cdk synth or cdk deploy command :
i am getting the above error
Error: All arguments to look up a security group must be concrete (no Tokens)
Please suggest what needs to be done here.
CDK CLI Version
1.132.0
Framework Version
No response
Node.js Version
17.0.1
OS
Mac
Language
Typescript
Language Version
Typescript(4.2.4)
Other information
Hi Team,
I have an implementation where i need to fetch the existing ECS Cluster details. I have the import values from the VPC and Security Group of another base stack. However, While using the Fn.importValue i am getting an error :
All arguments to look up a security group must be concrete (no Tokens)
Here is my source code
ecs.Cluster.fromClusterAttributes(this, 'existing', { clusterName: Fn.importValue(
${propsBackend.clusterName}-ExistingClusterStackName), vpc: vpc, securityGroups: [ ec2.SecurityGroup.fromLookup( this, 'ECSInstanceSecurityGroup', Fn.importValue(
${propsBackend.clusterName}-ExistingClusterSecurityGroup), ), ], });
Whenever i run the cdk synth or cdk deploy command : i am getting the above error Error: All arguments to look up a security group must be concrete (no Tokens)
Please suggest what needs to be done here.
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (3 by maintainers)
Top GitHub Comments
You can use the aws-sdk-js-v3 which has first-class Typescript support.
I don’t have any examples to reference but I can whip up some prototype projects for you. I’ll follow up with you in this thread.
⚠️ One thing to keep in mind is that you cannot
await
in Typescript class constructs.Options:
Wow. This works like charm! You are awesome!