Skip to content

Commit

Permalink
Merge pull request #1154 from onceupon/d-improve-awscc_elasticbeansta…
Browse files Browse the repository at this point in the history
…lk_environment

docs: add example for: elasticbeanstalk_environment
  • Loading branch information
marcosentino authored Aug 31, 2023
2 parents 911f38a + 9f4bdfb commit 95abb40
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 2 deletions.
27 changes: 25 additions & 2 deletions docs/resources/elasticbeanstalk_environment.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "awscc_elasticbeanstalk_environment Resource - terraform-provider-awscc"
subcategory: ""
description: |-
Expand All @@ -10,6 +9,30 @@ description: |-

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 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"
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.3 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"
}]
}
```


<!-- schema generated by tfplugindocs -->
Expand Down Expand Up @@ -76,4 +99,4 @@ Import is supported using the following syntax:

```shell
$ terraform import awscc_elasticbeanstalk_environment.example <resource ID>
```
```
Original file line number Diff line number Diff line change
@@ -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.3 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"
}]
}
28 changes: 28 additions & 0 deletions templates/resources/elasticbeanstalk_environment.md.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}"
subcategory: ""
description: |-
{{ .Description | plainmarkdown | trimspace | prefixlines " " }}
---

# {{.Name}} ({{.Type}})

{{ .Description | trimspace }}

## 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 your existing [instance profile](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/iam-instanceprofile.html).
{{ 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 }}

0 comments on commit 95abb40

Please sign in to comment.