AWS Cdk Custom Resource Creation
Can anyone please help me, I have been trying this thing for 5 days. I have a custom resource in AWS YAML format, which I want to create in AWS CDK. I am able to add condition and ServiceToken using AWS CDK CfnCustomResource but I can't add properties. Please help me to find out the solution.
YAML Template
LookupAmi:
Condition: UseGI
Properties:
ServiceToken:
Fn::ImportValue: !Join ['', [!If [ MyProd, '', 'qa-'], Prod-LookupAmiFunction]]
AMI: {Ref: AMI}
appId: {Ref: AppId}
envType: {Ref: EnvType}
osType: {Ref: OSType}
Type: Custom::AmiLookup
Corresponding AWS CDK typescript code which is working.
const LookupAmi = new cfn.CfnCustomResource(this, 'LookupAmi', {
serviceToken : "DSDS" # Just a random value but it is working
});LookupAmi.cfnOptions.condition = UseGI
I want to add properties of YAML template, how could I do it. Please help me........
here is a custom resource example. The properties can be any [key: string]: any;
We're happy to help you out, but GitHub issues is not a support forum. There are websites much better suited for that, such as StackOverflow.
Please ask that same question again on StackOverflow under the aws-cdk. If you can't get a response to your question, please bring it to our attention again and we will do our best to answer it.