diff --git a/docs/resources/resiliencehub_app.md b/docs/resources/resiliencehub_app.md index a0f181e414..bf22d1d2a0 100644 --- a/docs/resources/resiliencehub_app.md +++ b/docs/resources/resiliencehub_app.md @@ -10,7 +10,43 @@ description: |- Resource Type Definition for AWS::ResilienceHub::App. - +## Example Usage + +```terraform +resource "awscc_resiliencehub_app" "main" { + name = "test-app" + resource_mappings = [{ + physical_resource_id = { + identifier = "s3://terraform-state-files/test-app.tfstate" + type = "Native" + # Optional aws_region = "" + # Optional aws_account_id = "" + } + mapping_type = "Terraform" + # Optional resource_name = "" + # resource_type = "" + # logical_resource = { + # logical_resource_name = "" + # resource_mapping_name = "" + # resource_mapping_arn = awscc_resiliencehub_app.app.arn + }] + resiliency_policy_arn = "arn:aws:resiliencehub:us-west-1::resiliency-policy/" + app_template_body = < ## Schema diff --git a/examples/resources/awscc_resiliencehub_app/resiliencehub_app.tf b/examples/resources/awscc_resiliencehub_app/resiliencehub_app.tf new file mode 100644 index 0000000000..718401d9fc --- /dev/null +++ b/examples/resources/awscc_resiliencehub_app/resiliencehub_app.tf @@ -0,0 +1,46 @@ +resource "awscc_resiliencehub_app" "main" { + name = "test-app" + description = "This is a test app." + app_template_body = jsonencode({ + format_version = 2 + resources = [{ + name = "test-app" + type = "AWS::EC2::Instance" + parameters = { + tags = { + env = "dev" + } + } + }] + }) + resiliency_policy_arn = awscc_resiliencehub_resiliency_policy.test.arn + resource_mappings = [{ + physical_resource_id = { + identifier = "s3://terraform-state-files/test-app.tfstate" + type = "Native" + aws_region = "us-west-2" + aws_account_id = "112223333444" + } + mapping_type = "Terraform" + resource_name = "test-app" + resource_type = "AWS::EC2::Instance" + logical_resource = { + logical_resource_name = "test-app" + resource_mapping_arn = awscc_resiliencehub_app.app.arn + } + + }] + event_subscriptions = [{ + name = "test-app" + sns_topic_arn = awscc_sns_topic.sns_example.arn + }] + app_assessment_schedule = "Daily" + permission_model = { + type = "RoleBased" + invoker_role_name = "resilience-hub-test-app-role" + } + tags = [{ + key = "Modified By" + value = "AWSCC" + }] +} diff --git a/templates/resources/resiliencehub_app.md.tmpl b/templates/resources/resiliencehub_app.md.tmpl new file mode 100644 index 0000000000..c3fb1cb67d --- /dev/null +++ b/templates/resources/resiliencehub_app.md.tmpl @@ -0,0 +1,26 @@ +--- +page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" +subcategory: "" +description: |- +{{ .Description | plainmarkdown | trimspace | prefixlines " " }} +--- + +# {{.Name}} ({{.Type}}) + +{{ .Description | trimspace }} + +## Example Usage + +{{ tffile (printf "examples/resources/%s/resiliencehub_app.tf" .Name)}} + + +{{ .SchemaMarkdown | trimspace }} +{{- if .HasImport }} + +## Import + +Import is supported using the following syntax: + +{{ codefile "shell" .ImportFile }} + +{{- end }}