Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: added example for resilience hub app #2102

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
38 changes: 37 additions & 1 deletion docs/resources/resiliencehub_app.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:<account-id>:resiliency-policy/<id>"
app_template_body = <<EOF
{ "resources": [], "appComponents": [], "excludedResources": { "logicalResourceIds": [] }, "version": 2 }
EOF
description = "This is a test app."
app_assessment_schedule = "Daily"
event_subscriptions = []
permission_model = {
type = "RoleBased"
# Optional invoker_role_name = "resilience-hub-test-app-role"
}
tags = [{
key = "Modified By"
value = "AWSCC"
}]
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down
34 changes: 34 additions & 0 deletions examples/resources/awscc_resiliencehub_app/resiliencehub_app.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
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:<account-id>:resiliency-policy/<id>"
app_template_body = <<EOF
{ "resources": [], "appComponents": [], "excludedResources": { "logicalResourceIds": [] }, "version": 2 }
EOF
description = "This is a test app."
app_assessment_schedule = "Daily"
event_subscriptions = []
permission_model = {
type = "RoleBased"
# Optional invoker_role_name = "resilience-hub-test-app-role"
}
tags = [{
key = "Modified By"
value = "AWSCC"
}]
}

26 changes: 26 additions & 0 deletions templates/resources/resiliencehub_app.md.tmpl
Original file line number Diff line number Diff line change
@@ -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 }}