From 6f5b4379e829e6db28ce108242bf017d457a2e75 Mon Sep 17 00:00:00 2001 From: Bonnie Ng Date: Fri, 18 Aug 2023 07:51:20 +0000 Subject: [PATCH 1/3] docs: add example for: elasticbeanstalk_environment --- .../resources/elasticbeanstalk_environment.md | 26 ++++++++++++++++-- .../elasticbeanstalk_environment.tf | 18 +++++++++++++ .../elasticbeanstalk_environment.md.tmpl | 27 +++++++++++++++++++ 3 files changed, 69 insertions(+), 2 deletions(-) create mode 100644 examples/resources/awscc_elasticbeanstalk_environment/elasticbeanstalk_environment.tf create mode 100644 templates/resources/elasticbeanstalk_environment.md.tmpl diff --git a/docs/resources/elasticbeanstalk_environment.md b/docs/resources/elasticbeanstalk_environment.md index 91c85d969d..f7ee4dddcc 100644 --- a/docs/resources/elasticbeanstalk_environment.md +++ b/docs/resources/elasticbeanstalk_environment.md @@ -1,5 +1,4 @@ --- -# generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "awscc_elasticbeanstalk_environment Resource - terraform-provider-awscc" subcategory: "" description: |- @@ -10,6 +9,29 @@ description: |- Resource Type definition for AWS::ElasticBeanstalk::Environment +## Example Usage + +### Basic usage with Python platform +```terraform +resource "awscc_elasticbeanstalk_application" "example-app" { + application_name = "example-app" + description = "example-app" +} + +resource "awscc_elasticbeanstalk_environment" "example-env" { + application_name = awscc_elasticbeanstalk_application.example-app.application_name + solution_stack_name = "64bit Amazon Linux 2023 v4.0.2 running Python 3.11" + option_settings = [{ + namespace = "aws:autoscaling:launchconfiguration" + option_name = "IamInstanceProfile" + value = "example-aws-elasticbeanstalk-ec2-role" + }] + tags = [{ + key = "Managed By" + value = "AWSCC" + }] +} +``` @@ -76,4 +98,4 @@ Import is supported using the following syntax: ```shell $ terraform import awscc_elasticbeanstalk_environment.example -``` +``` \ No newline at end of file diff --git a/examples/resources/awscc_elasticbeanstalk_environment/elasticbeanstalk_environment.tf b/examples/resources/awscc_elasticbeanstalk_environment/elasticbeanstalk_environment.tf new file mode 100644 index 0000000000..c62644b326 --- /dev/null +++ b/examples/resources/awscc_elasticbeanstalk_environment/elasticbeanstalk_environment.tf @@ -0,0 +1,18 @@ +resource "awscc_elasticbeanstalk_application" "example-app" { + application_name = "example-app" + description = "example-app" +} + +resource "awscc_elasticbeanstalk_environment" "example-env" { + application_name = awscc_elasticbeanstalk_application.example-app.application_name + solution_stack_name = "64bit Amazon Linux 2023 v4.0.2 running Python 3.11" + option_settings = [{ + namespace = "aws:autoscaling:launchconfiguration" + option_name = "IamInstanceProfile" + value = "example-aws-elasticbeanstalk-ec2-role" + }] + tags = [{ + key = "Managed By" + value = "AWSCC" + }] +} diff --git a/templates/resources/elasticbeanstalk_environment.md.tmpl b/templates/resources/elasticbeanstalk_environment.md.tmpl new file mode 100644 index 0000000000..5342a3ba78 --- /dev/null +++ b/templates/resources/elasticbeanstalk_environment.md.tmpl @@ -0,0 +1,27 @@ +--- +page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" +subcategory: "" +description: |- +{{ .Description | plainmarkdown | trimspace | prefixlines " " }} +--- + +# {{.Name}} ({{.Type}}) + +{{ .Description | trimspace }} + +## Example Usage + +### Basic usage with Python platform +{{ tffile (printf "examples/resources/%s/elasticbeanstalk_environment.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 94bb96da1db4c65d7af505ab5a8e404441290a25 Mon Sep 17 00:00:00 2001 From: Bonnie Ng Date: Fri, 18 Aug 2023 11:05:05 +0000 Subject: [PATCH 2/3] docs: add example for: elasticbeanstalk_environment --- docs/resources/elasticbeanstalk_environment.md | 3 ++- .../elasticbeanstalk_environment.tf | 2 +- templates/resources/elasticbeanstalk_environment.md.tmpl | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/resources/elasticbeanstalk_environment.md b/docs/resources/elasticbeanstalk_environment.md index f7ee4dddcc..d422f0d492 100644 --- a/docs/resources/elasticbeanstalk_environment.md +++ b/docs/resources/elasticbeanstalk_environment.md @@ -12,6 +12,7 @@ Resource Type definition for AWS::ElasticBeanstalk::Environment ## Example Usage ### Basic usage with Python platform +In this example, we are going to create an AWS Elastic Beanstalk environment using Python platform. Please refer to [Python platform history](https://docs.aws.amazon.com/elasticbeanstalk/latest/platforms/platform-history-python.html) and use the current platform version and solution stack name. Also, please replace `example-aws-elasticbeanstalk-ec2-role` with an existing [instance profile](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/iam-instanceprofile.html). ```terraform resource "awscc_elasticbeanstalk_application" "example-app" { application_name = "example-app" @@ -20,7 +21,7 @@ resource "awscc_elasticbeanstalk_application" "example-app" { resource "awscc_elasticbeanstalk_environment" "example-env" { application_name = awscc_elasticbeanstalk_application.example-app.application_name - solution_stack_name = "64bit Amazon Linux 2023 v4.0.2 running Python 3.11" + solution_stack_name = "64bit Amazon Linux 2023 v4.0.3 running Python 3.11" option_settings = [{ namespace = "aws:autoscaling:launchconfiguration" option_name = "IamInstanceProfile" diff --git a/examples/resources/awscc_elasticbeanstalk_environment/elasticbeanstalk_environment.tf b/examples/resources/awscc_elasticbeanstalk_environment/elasticbeanstalk_environment.tf index c62644b326..a59dccc031 100644 --- a/examples/resources/awscc_elasticbeanstalk_environment/elasticbeanstalk_environment.tf +++ b/examples/resources/awscc_elasticbeanstalk_environment/elasticbeanstalk_environment.tf @@ -5,7 +5,7 @@ resource "awscc_elasticbeanstalk_application" "example-app" { resource "awscc_elasticbeanstalk_environment" "example-env" { application_name = awscc_elasticbeanstalk_application.example-app.application_name - solution_stack_name = "64bit Amazon Linux 2023 v4.0.2 running Python 3.11" + solution_stack_name = "64bit Amazon Linux 2023 v4.0.3 running Python 3.11" option_settings = [{ namespace = "aws:autoscaling:launchconfiguration" option_name = "IamInstanceProfile" diff --git a/templates/resources/elasticbeanstalk_environment.md.tmpl b/templates/resources/elasticbeanstalk_environment.md.tmpl index 5342a3ba78..bde5fa9454 100644 --- a/templates/resources/elasticbeanstalk_environment.md.tmpl +++ b/templates/resources/elasticbeanstalk_environment.md.tmpl @@ -12,6 +12,7 @@ description: |- ## Example Usage ### Basic usage with Python platform +In this example, we are going to create an AWS Elastic Beanstalk environment using Python platform. Please refer to [Python platform history](https://docs.aws.amazon.com/elasticbeanstalk/latest/platforms/platform-history-python.html) and use the current platform version and solution stack name. Also, please replace `example-aws-elasticbeanstalk-ec2-role` with an existing [instance profile](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/iam-instanceprofile.html). {{ tffile (printf "examples/resources/%s/elasticbeanstalk_environment.tf" .Name)}} From 9f4bdfb487f772943cdae2be8e070653b4b3e7b3 Mon Sep 17 00:00:00 2001 From: Bonnie Ng Date: Fri, 18 Aug 2023 11:13:44 +0000 Subject: [PATCH 3/3] docs: add example for: elasticbeanstalk_environment --- docs/resources/elasticbeanstalk_environment.md | 2 +- templates/resources/elasticbeanstalk_environment.md.tmpl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/resources/elasticbeanstalk_environment.md b/docs/resources/elasticbeanstalk_environment.md index d422f0d492..d5a6bdec19 100644 --- a/docs/resources/elasticbeanstalk_environment.md +++ b/docs/resources/elasticbeanstalk_environment.md @@ -12,7 +12,7 @@ Resource Type definition for AWS::ElasticBeanstalk::Environment ## Example Usage ### Basic usage with Python platform -In this example, we are going to create an AWS Elastic Beanstalk environment using Python platform. Please refer to [Python platform history](https://docs.aws.amazon.com/elasticbeanstalk/latest/platforms/platform-history-python.html) and use the current platform version and solution stack name. Also, please replace `example-aws-elasticbeanstalk-ec2-role` with an existing [instance profile](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/iam-instanceprofile.html). +In this example, we are going to create an AWS Elastic Beanstalk environment using Python platform. Please refer to [Python platform history](https://docs.aws.amazon.com/elasticbeanstalk/latest/platforms/platform-history-python.html) and use the current platform version and solution stack name. Also, please replace `example-aws-elasticbeanstalk-ec2-role` with your existing [instance profile](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/iam-instanceprofile.html). ```terraform resource "awscc_elasticbeanstalk_application" "example-app" { application_name = "example-app" diff --git a/templates/resources/elasticbeanstalk_environment.md.tmpl b/templates/resources/elasticbeanstalk_environment.md.tmpl index bde5fa9454..49e263d0ca 100644 --- a/templates/resources/elasticbeanstalk_environment.md.tmpl +++ b/templates/resources/elasticbeanstalk_environment.md.tmpl @@ -12,7 +12,7 @@ description: |- ## Example Usage ### Basic usage with Python platform -In this example, we are going to create an AWS Elastic Beanstalk environment using Python platform. Please refer to [Python platform history](https://docs.aws.amazon.com/elasticbeanstalk/latest/platforms/platform-history-python.html) and use the current platform version and solution stack name. Also, please replace `example-aws-elasticbeanstalk-ec2-role` with an existing [instance profile](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/iam-instanceprofile.html). +In this example, we are going to create an AWS Elastic Beanstalk environment using Python platform. Please refer to [Python platform history](https://docs.aws.amazon.com/elasticbeanstalk/latest/platforms/platform-history-python.html) and use the current platform version and solution stack name. Also, please replace `example-aws-elasticbeanstalk-ec2-role` with your existing [instance profile](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/iam-instanceprofile.html). {{ tffile (printf "examples/resources/%s/elasticbeanstalk_environment.tf" .Name)}}