Creating Resource Explorer resources with CloudFormation - Amazon Resource Explorer
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Creating Resource Explorer resources with CloudFormation

Amazon Resource Explorer is integrated with Amazon CloudFormation, a service that helps you model and set up your Amazon resources. This integration helps you spend less time creating and managing your resources and infrastructure. You create a template that describes all the Amazon resources that you want, and CloudFormation provisions and configures those resources for you. Examples of resources include indexes, views, or the assignment of a default view for an Amazon Web Services Region.

When you use CloudFormation, you can reuse your template to set up your Resource Explorer resources consistently and repeatedly. Just describe your resources once, and then provision the same resources over and over in multiple Amazon Web Services accounts and Regions.

Using Amazon CloudFormation to deploy Resource Explorer to Amazon Organizations

You can use Amazon CloudFormation StackSets to deploy Resource Explorer to all of the accounts in your organization. When you add or create member accounts in your organiztaion, StackSets can automatically configure indexes in each Amazon Web Services Region, including an aggregator index where you specify, to each new member account. For instructions, see Deploying Resource Explorer to the accounts in an organization.

Resource Explorer and CloudFormation templates

To provision and configure resources for Resource Explorer and related services, you must understand Amazon 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 Amazon CloudFormation Designer to help you get started with CloudFormation templates. For more information, see What is Amazon CloudFormation Designer? in the Amazon CloudFormation User Guide.

Resource Explorer supports creating the following resource types in CloudFormation:

The following example illustrates how you might create one index and a view in the same Region, and set the view to be the default for the Region.

YAML

Description: >- Sample CFN Stack setting up Resource Explorer with an aggregator index and a default view Resources: SampleIndex: Type: 'AWS::ResourceExplorer2::Index' Properties: Type: AGGREGATOR Tags: Purpose: ResourceExplorer Sample CFN Stack SampleView: Type: 'AWS::ResourceExplorer2::View' Properties: ViewName: mySampleView IncludedProperties: - Name: tags Tags: Purpose: ResourceExplorer Sample CFN Stack DependsOn: SampleIndex SampleDefaultViewAssociation: Type: 'AWS::ResourceExplorer2::DefaultViewAssociation' Properties: ViewArn: !Ref SampleView

JSON

{ "Description": "Sample CFN Stack setting up Resource Explorer with an aggregator index and a default view ", "Resources": { "SampleIndex": { "Type": "AWS::ResourceExplorer2::Index", "Properties": { "Type": "AGGREGATOR", "Tags": { "Purpose": "ResourceExplorer Sample Stack" } } }, "SampleView": { "Type": "AWS::ResourceExplorer2::View", "Properties": { "ViewName": "mySampleView", "IncludedProperties": [ { "Name": "tags" } ], "Tags": { "Purpose": "ResourceExplorer Sample CFN Stack" } }, "DependsOn": "SampleIndex" }, "SampleDefaultViewAssociation": { "Type": "AWS::ResourceExplorer2::DefaultViewAssociation", "Properties": { "ViewArn": { "Ref": "SampleView" } } } } }

For more information, including examples of JSON and YAML templates for Resource Explorer indexes and views, see the ResourceExplorer2 resource type reference in the Amazon CloudFormation User Guide.

Learn more about Amazon CloudFormation

To learn more about CloudFormation, see the following resources: