I have a custom resource in AWS YAML format, for which I want to create AWS CDK code. I am able to add condition and ServiceToken using AWS CDK CfnCustomResource but I can't add properties.
YAML Template
MyAmi:
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::MyAmi
Corresponding AWS CDK typescript code which is working.
const MyAmi= new cfn.CfnCustomResource(this, 'MyAmi', {
serviceToken : "DSDS" # Just a random value but it is working
});MyAmi.cfnOptions.condition = UsemE
I want to add properties of YAML template, how could I do it.