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

f-aws_mwaa_environment: added endpoint service as output #36903

Merged
merged 5 commits into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/36903.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/aws_mwaa_environment: Add `database_vpc_endpoint_service` and `webserver_vpc_endpoint_service` attributes
```
10 changes: 10 additions & 0 deletions internal/service/mwaa/environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ func ResourceEnvironment() *schema.Resource {
Type: schema.TypeString,
Computed: true,
},
"database_vpc_endpoint_service": {
Type: schema.TypeString,
Computed: true,
},
"dag_s3_path": {
Type: schema.TypeString,
Required: true,
Expand Down Expand Up @@ -272,6 +276,10 @@ func ResourceEnvironment() *schema.Resource {
Type: schema.TypeString,
Computed: true,
},
"webserver_vpc_endpoint_service": {
Type: schema.TypeString,
Computed: true,
},
"weekly_maintenance_window_start": {
Type: schema.TypeString,
Optional: true,
Expand Down Expand Up @@ -430,6 +438,7 @@ func resourceEnvironmentRead(ctx context.Context, d *schema.ResourceData, meta i
d.Set("arn", environment.Arn)
d.Set("created_at", aws.ToTime(environment.CreatedAt).String())
d.Set("dag_s3_path", environment.DagS3Path)
d.Set("database_vpc_endpoint_service", environment.DatabaseVpcEndpointService)
d.Set("endpoint_management", environment.EndpointManagement)
d.Set("environment_class", environment.EnvironmentClass)
d.Set("execution_role_arn", environment.ExecutionRoleArn)
Expand Down Expand Up @@ -458,6 +467,7 @@ func resourceEnvironmentRead(ctx context.Context, d *schema.ResourceData, meta i
d.Set("status", environment.Status)
d.Set("webserver_access_mode", environment.WebserverAccessMode)
d.Set("webserver_url", environment.WebserverUrl)
d.Set("webserver_vpc_endpoint_service", environment.WebserverVpcEndpointService)
d.Set("weekly_maintenance_window_start", environment.WeeklyMaintenanceWindowStart)

setTagsOut(ctx, environment.Tags)
Expand Down
2 changes: 2 additions & 0 deletions internal/service/mwaa/environment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ func TestAccMWAAEnvironment_basic(t *testing.T) {
resource.TestCheckResourceAttrSet(resourceName, "airflow_version"),
acctest.CheckResourceAttrRegionalARN(resourceName, "arn", "airflow", "environment/"+rName),
resource.TestCheckResourceAttrSet(resourceName, "created_at"),
resource.TestCheckResourceAttrSet(resourceName, "database_vpc_endpoint_service"),
resource.TestCheckResourceAttrSet(resourceName, "webserver_vpc_endpoint_service"),
resource.TestCheckResourceAttr(resourceName, "dag_s3_path", "dags/"),
resource.TestCheckResourceAttr(resourceName, "environment_class", "mw1.small"),
acctest.CheckResourceAttrGlobalARN(resourceName, "execution_role_arn", "iam", "role/service-role/"+rName),
Expand Down
2 changes: 2 additions & 0 deletions website/docs/r/mwaa_environment.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,13 @@ This resource exports the following attributes in addition to the arguments abov

* `arn` - The ARN of the MWAA Environment
* `created_at` - The Created At date of the MWAA Environment
* `database_vpc_endpoint_service` - The VPC endpoint for the environment's Amazon RDS database
* `logging_configuration[0].<LOG_CONFIGURATION_TYPE>[0].cloud_watch_log_group_arn` - Provides the ARN for the CloudWatch group where the logs will be published
* `service_role_arn` - The Service Role ARN of the Amazon MWAA Environment
* `status` - The status of the Amazon MWAA Environment
* `tags_all` - A map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block).
* `webserver_url` - The webserver URL of the MWAA Environment
* `webserver_vpc_endpoint_service` - The VPC endpoint for the environment's web server

## Timeouts

Expand Down
Loading