I wanted to output a value I get form an CloudFormation Custom Resource. I'm definitely returning the value, but I wasn't sure how to reference it in an output
This is my template.yml:
Outputs:
customresourceoutput:
Value:
!GetAtt creates3bucketlambda.myvalue
Resources:
creates3bucketlambda:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
Runtime: nodejs6.10
CodeUri: setups3bucket
MemorySize: 512
Timeout: 300
Policies:
- AWSLambdaBasicExecutionRole
- AmazonS3FullAccess
Creates3BucketLoginPage:
Type: Custom::AppConfiguration
Properties:
ServiceToken: !GetAtt creates3bucketlambda.Arn
aOrg:
!Ref aOrg
The Error I get is:
Failed to create the changeset: Waiter
ChangeSetCreateComplete failed: Waiter encountered a terminal failure
state Status: FAILED. Reason: Template error: resource
creates3bucketlambda does not support attribute type myvalue in
Fn::GetAtt
I'm not sure if I use a !Sub, !Ref
So basically you can return two things from the AWS::Serverless::Function
customresourceoutput:
Value:
!GetAtt creates3bucketlambda.Arn -> arn of lambda function
and
customresourceoutput:
Value:
!Ref creates3bucketlambda -> name of lambda function
More details about serverless function outputs here.
If you're interested in AWS::CloudFormation::CustomResource there is also a documentation for that.
You can use Fn::GetAtt like:
customresourceoutput:
Value:
!GetAtt customerResource.responseKeyName -> name of the key from the response
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With