From 1a2325a5e52519ed4725510d5c39049b52c9c0db Mon Sep 17 00:00:00 2001 From: emned Date: Wed, 8 Jan 2025 10:48:42 +0000 Subject: [PATCH 1/3] docs: add example for awscc_vpclattice_resource_gateway --- .../awscc_vpclattice_resource_gateway_ipv4.tf | 6 +++++ .../vpclattice_resource_gateway.md.tmpl | 26 +++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 examples/resources/awscc_vpclattice_resource_gateway/awscc_vpclattice_resource_gateway_ipv4.tf create mode 100644 templates/resources/vpclattice_resource_gateway.md.tmpl diff --git a/examples/resources/awscc_vpclattice_resource_gateway/awscc_vpclattice_resource_gateway_ipv4.tf b/examples/resources/awscc_vpclattice_resource_gateway/awscc_vpclattice_resource_gateway_ipv4.tf new file mode 100644 index 000000000..b2c650445 --- /dev/null +++ b/examples/resources/awscc_vpclattice_resource_gateway/awscc_vpclattice_resource_gateway_ipv4.tf @@ -0,0 +1,6 @@ +resource "awscc_vpclattice_resource_gateway" "example" { + name = "example-gateway" + vpc_identifier = awscc_ec2_vpc.example.id + subnet_ids = [awscc_ec2_subnet.example.id] + ip_address_type = "IPV4" +} \ No newline at end of file diff --git a/templates/resources/vpclattice_resource_gateway.md.tmpl b/templates/resources/vpclattice_resource_gateway.md.tmpl new file mode 100644 index 000000000..c336be3a3 --- /dev/null +++ b/templates/resources/vpclattice_resource_gateway.md.tmpl @@ -0,0 +1,26 @@ +--- +page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" +subcategory: "" +description: |- +{{ .Description | plainmarkdown | trimspace | prefixlines " " }} +--- + +# {{.Name}} ({{.Type}}) + +{{ .Description | trimspace }} + +## Example Usage + +### Basic Usage +{{ tffile (printf "examples/resources/%s/awscc_vpclattice_resource_gateway_ipv4.tf" .Name)}} + +{{ .SchemaMarkdown | trimspace }} +{{- if .HasImport }} + +## Import + +Import is supported using the following syntax: + +{{ codefile "shell" .ImportFile }} + +{{- end }} \ No newline at end of file From e44370d5bb683bd1cca58bc24ff776907bc291d4 Mon Sep 17 00:00:00 2001 From: emned Date: Wed, 8 Jan 2025 14:03:30 +0000 Subject: [PATCH 2/3] add .md file --- .../vpclattice_resource_configuration.md | 25 ++++++++++++++++--- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/docs/resources/vpclattice_resource_configuration.md b/docs/resources/vpclattice_resource_configuration.md index a9a3e202b..45f8f7753 100644 --- a/docs/resources/vpclattice_resource_configuration.md +++ b/docs/resources/vpclattice_resource_configuration.md @@ -1,5 +1,4 @@ --- -# generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "awscc_vpclattice_resource_configuration Resource - terraform-provider-awscc" subcategory: "" description: |- @@ -10,7 +9,25 @@ description: |- VpcLattice ResourceConfiguration CFN resource - +## Example Usage + +### Basic Usage +To use awscc_vpclattice_resource_configuration on single AWS account: +```terraform +resource "awscc_vpclattice_resource_configuration" "example" { + name = "example-resource-configuration" + port_ranges = ["80"] + protocol_type = "TCP" + resource_gateway_id = awscc_vpclattice_resource_gateway.example.id + resource_configuration_type = "SINGLE" + resource_configuration_definition = { + dns_resource = { + domain_name = "example.com" + ip_address_type = "IPV4" + } + } +} +``` ## Schema @@ -66,5 +83,5 @@ Optional: Import is supported using the following syntax: ```shell -$ terraform import awscc_vpclattice_resource_configuration.example "arn" -``` +terraform import random_password.password securepassword +``` \ No newline at end of file From e7a435d31b6c2d8f283b8b96c37000fbfbbc525d Mon Sep 17 00:00:00 2001 From: emned Date: Thu, 9 Jan 2025 08:56:09 +0000 Subject: [PATCH 3/3] fixed typo in .md.tmpl --- .../vpclattice_resource_configuration.md | 25 +++---------------- docs/resources/vpclattice_resource_gateway.md | 13 ++++++++-- 2 files changed, 15 insertions(+), 23 deletions(-) diff --git a/docs/resources/vpclattice_resource_configuration.md b/docs/resources/vpclattice_resource_configuration.md index 45f8f7753..a9a3e202b 100644 --- a/docs/resources/vpclattice_resource_configuration.md +++ b/docs/resources/vpclattice_resource_configuration.md @@ -1,4 +1,5 @@ --- +# generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "awscc_vpclattice_resource_configuration Resource - terraform-provider-awscc" subcategory: "" description: |- @@ -9,25 +10,7 @@ description: |- VpcLattice ResourceConfiguration CFN resource -## Example Usage - -### Basic Usage -To use awscc_vpclattice_resource_configuration on single AWS account: -```terraform -resource "awscc_vpclattice_resource_configuration" "example" { - name = "example-resource-configuration" - port_ranges = ["80"] - protocol_type = "TCP" - resource_gateway_id = awscc_vpclattice_resource_gateway.example.id - resource_configuration_type = "SINGLE" - resource_configuration_definition = { - dns_resource = { - domain_name = "example.com" - ip_address_type = "IPV4" - } - } -} -``` + ## Schema @@ -83,5 +66,5 @@ Optional: Import is supported using the following syntax: ```shell -terraform import random_password.password securepassword -``` \ No newline at end of file +$ terraform import awscc_vpclattice_resource_configuration.example "arn" +``` diff --git a/docs/resources/vpclattice_resource_gateway.md b/docs/resources/vpclattice_resource_gateway.md index e862e707a..3de883289 100644 --- a/docs/resources/vpclattice_resource_gateway.md +++ b/docs/resources/vpclattice_resource_gateway.md @@ -1,5 +1,4 @@ --- -# generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "awscc_vpclattice_resource_gateway Resource - terraform-provider-awscc" subcategory: "" description: |- @@ -10,7 +9,17 @@ description: |- Creates a resource gateway for a service. +## Example Usage +### Basic Usage +```terraform +resource "awscc_vpclattice_resource_gateway" "example" { + name = "example-gateway" + vpc_identifier = awscc_ec2_vpc.example.id + subnet_ids = [awscc_ec2_subnet.example.id] + ip_address_type = "IPV4" +} +``` ## Schema @@ -44,4 +53,4 @@ Import is supported using the following syntax: ```shell $ terraform import awscc_vpclattice_resource_gateway.example "arn" -``` +``` \ No newline at end of file