Create resources with AWS CloudFormation
Amazon Location Service is integrated with CloudFormation, a service that helps you to model and set up your AWS resources so that you can spend less time creating and managing your resources and infrastructure. You create a template that describes all the AWS resources that you want (such as Amazon Location resources), and CloudFormation provisions and configures those resources for you.
When you use CloudFormation, you can reuse your template to set up your Amazon Location resources consistently and repeatedly. Describe your resources once, and then provision the same resources over and over in multiple AWS accounts and Regions.
Related CloudFormation templates
To provision and configure resources for Amazon Location and related services, you must understand CloudFormation templates. Templates are formatted text files in JSON or YAML. These templates describe the resources that you want to provision in your CloudFormation stacks. If you're unfamiliar with JSON or YAML, you can use Infrastructure Composer to help you get started with CloudFormation templates. For more information, see Infrastructure Composer in the CloudFormation User Guide.
Amazon Location supports creating the following resource types in CloudFormation:
For more information, including examples of JSON and YAML templates for Amazon Location resources, see the Amazon Location Service resource type reference in the CloudFormation Template Reference.
Required permissions
CloudFormation uses an IAM identity to create and update your Amazon Location resources. This identity is one of the following:
-
The service role you specify for the stack.
-
The CloudFormation execution role, if you deploy with the AWS CDK.
-
Your own IAM identity, if you don't specify a service role.
Starting February 26, 2027, this identity needs permission to use the geo:TagResource action to create Amazon Location resources that support tags, and to replace them during a stack update. Of the resource types listed above, only AWS::Location::TrackerConsumer doesn't support tags, and it isn't affected.
The permission is required even if your template doesn't specify tags. CloudFormation adds the aws:cloudformation:stack-name, aws:cloudformation:stack-id, and aws:cloudformation:logical-id tags to each resource it creates. For more information about the tags that CloudFormation adds, see the CloudFormation Template Reference. To learn how to manage the required permissions, see Grant permission to tag resources.
Step 1: Add the permission
Add the following statement to the policy of the identity that CloudFormation uses:
{ "Effect": "Allow", "Action": "geo:TagResource", "Resource": "arn:aws:geo:region:account-id:*" }
You don't need to add the statement if the identity already allows geo:TagResource, for example through geo:* or the AdministratorAccess managed policy.
If you deploy with the AWS CDK, the CloudFormation execution role uses the AdministratorAccess policy by default, which already allows this action. You need to add the statement only if you use managed policies. For more information, see Customize AWS CDK bootstrapping in the AWS CDK Developer Guide.
Step 2: Check for the error
If the identity doesn't have permission to use geo:TagResource, the resource fails to create and the stack event shows the following message.
Resource handler returned message: "Access denied for operation 'AWS::Location::PlaceIndex'." (RequestToken:request-token, HandlerErrorCode: AccessDenied)
Existing resources and stack updates
Existing resources keep working.
-
Stack updates that replace a resource require
geo:TagResource, including for stacks created before February 26, 2027. For example, changingIndexNameforAWS::Location::PlaceIndexreplaces the resource. If the permission is missing, CloudFormation rolls back the update. -
Stack updates that don't replace a resource, and stack deletes, don't require the new permission. Resources created before February 26, 2027 don't receive the CloudFormation tags from these updates.
Learn more about CloudFormation
To learn more about CloudFormation, see the following resources: