CloudFormation template components

As always, we will start with the template version and description. The options for the following resource types have not changed much: RestApi, Resource, and Deployment. The Outputs section is also the same as before. Within the method declaration, we used the AWS integration type, along with a URI in the required format.

Within the management console, you have a separate Lambda Integration option and AWS integration option. However, with CLI commands and CloudFormation templates, the AWS integration option is used for both cases. 

We have introduced a new intrinsic function: Fn::ImportValue. Fn::ImportValue gets the value of an output exported by another stack (in our case, the Lambda stack). Exports and imports are only allowed within regions, and export names must be unique within a region.

We also used a new type, AWS::Lambda::Permission, to add a permission to a Lambda. The options are similar to the CLI commands we used, but we have used CloudFormation intrinsic functions and variables to avoid any hardcoding. When working with API gateway, you only need to use SourceArn to specify the SourceAccount. However, if you are specifying a resource, such as an S3 bucket, you need to specify the SourceAccount option as well. 

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.137.75