diff --git a/docs/resources/greengrassv2_deployment.md b/docs/resources/greengrassv2_deployment.md index b09cfba41b..d78b189bd6 100644 --- a/docs/resources/greengrassv2_deployment.md +++ b/docs/resources/greengrassv2_deployment.md @@ -1,5 +1,4 @@ --- -# generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "awscc_greengrassv2_deployment Resource - terraform-provider-awscc" subcategory: "" description: |- @@ -10,7 +9,80 @@ description: |- Resource for Greengrass V2 deployment. - +## Example Usage + +```terraform +resource "awscc_greengrassv2_deployment" "example" { + deployment_name = "example" + target_arn = awscc_iot_thing.example.arn + deployment_policies = { + configuration_validation_policy = { + timeout_in_seconds = 60 + } + component_update_policy = { + timeout_in_seconds = 55 + } + failure_handling_policy = "ROLLBACK" + } + + components = { + "aws.greengrass.Nucleus" = { + component_version = "2.12.4" + configuration_update = { + reset = [""] + merge = jsonencode( + { + "spooler" : { + "storageType" : "Disk" + "maxSizeInBytes" : "2048" + } + } + ) + } + }, + "aws.greengrass.LogManager" = { + component_version = "2.3.7" + configuration_update = { + reset = [""] + merge = jsonencode( + { + "logsUploaderConfiguration" : { + "systemLogsConfiguration" : { + "uploadToCloudWatch" : "true", + "minimumLogLevel" : "INFO", + "diskSpaceLimit" : "10", + "diskSpaceLimitUnit" : "MB", + "deleteLogFileAfterCloudUpload" : "false" + }, + "componentLogsConfigurationMap" : { + "aws.greengrass.SystemsManagerAgent" : { + "minimumLogLevel" : "INFO", + "diskSpaceLimit" : "20", + "diskSpaceLimitUnit" : "MB", + "deleteLogFileAfterCloudUpload" : "false" + } + } + }, + "periodicUploadIntervalSec" : "300", + "deprecatedVersionSupport" : "false" + } + ) + } + } + } + +} + + +resource "awscc_iot_thing" "example" { + thing_name = "example" + attribute_payload = { + attributes = { + name = "examplevalue" + } + } +} +``` ## Schema @@ -168,3 +240,8 @@ Import is supported using the following syntax: ```shell $ terraform import awscc_greengrassv2_deployment.example "deployment_id" ``` + + + + + diff --git a/examples/resources/awscc_greengrassv2_deployment/greengrassv2_deployment.tf b/examples/resources/awscc_greengrassv2_deployment/greengrassv2_deployment.tf new file mode 100644 index 0000000000..e141cc1fa4 --- /dev/null +++ b/examples/resources/awscc_greengrassv2_deployment/greengrassv2_deployment.tf @@ -0,0 +1,70 @@ +resource "awscc_greengrassv2_deployment" "example" { + deployment_name = "example" + target_arn = awscc_iot_thing.example.arn + deployment_policies = { + configuration_validation_policy = { + timeout_in_seconds = 60 + } + component_update_policy = { + timeout_in_seconds = 55 + } + failure_handling_policy = "ROLLBACK" + } + + components = { + "aws.greengrass.Nucleus" = { + component_version = "2.12.4" + configuration_update = { + reset = [""] + merge = jsonencode( + { + "spooler" : { + "storageType" : "Disk" + "maxSizeInBytes" : "2048" + } + } + ) + } + }, + "aws.greengrass.LogManager" = { + component_version = "2.3.7" + configuration_update = { + reset = [""] + merge = jsonencode( + { + "logsUploaderConfiguration" : { + "systemLogsConfiguration" : { + "uploadToCloudWatch" : "true", + "minimumLogLevel" : "INFO", + "diskSpaceLimit" : "10", + "diskSpaceLimitUnit" : "MB", + "deleteLogFileAfterCloudUpload" : "false" + }, + "componentLogsConfigurationMap" : { + "aws.greengrass.SystemsManagerAgent" : { + "minimumLogLevel" : "INFO", + "diskSpaceLimit" : "20", + "diskSpaceLimitUnit" : "MB", + "deleteLogFileAfterCloudUpload" : "false" + } + } + }, + "periodicUploadIntervalSec" : "300", + "deprecatedVersionSupport" : "false" + } + ) + } + } + } + +} + + +resource "awscc_iot_thing" "example" { + thing_name = "example" + attribute_payload = { + attributes = { + name = "examplevalue" + } + } +} \ No newline at end of file diff --git a/templates/resources/greengrassv2_deployment.md.tmpl b/templates/resources/greengrassv2_deployment.md.tmpl new file mode 100644 index 0000000000..e68aff151d --- /dev/null +++ b/templates/resources/greengrassv2_deployment.md.tmpl @@ -0,0 +1,30 @@ +--- +page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" +subcategory: "" +description: |- +{{ .Description | plainmarkdown | trimspace | prefixlines " " }} +--- + +# {{.Name}} ({{.Type}}) + +{{ .Description | trimspace }} + +## Example Usage + +{{ tffile (printf "examples/resources/%s/greengrassv2_deployment.tf" .Name)}} + +{{ .SchemaMarkdown | trimspace }} +{{- if .HasImport }} + +## Import + +Import is supported using the following syntax: + +{{ codefile "shell" .ImportFile }} + +{{- end }} + + + + +