Skip to content

Commit

Permalink
fix: add the attribute "environment_id" to aws_appconfig_environment
Browse files Browse the repository at this point in the history
  • Loading branch information
suzuki-shunsuke committed Jul 14, 2021
1 parent 72e6234 commit dc0ef30
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions aws/resource_aws_appconfig_environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ func resourceAwsAppconfigEnvironment() *schema.Resource {
ForceNew: true,
ValidateFunc: validation.StringMatch(regexp.MustCompile(`[a-z0-9]{4,7}`), ""),
},
"environment_id": {
Type: schema.TypeString,
Computed: true,
},
"arn": {
Type: schema.TypeString,
Computed: true,
Expand Down Expand Up @@ -110,6 +114,7 @@ func resourceAwsAppconfigEnvironmentCreate(d *schema.ResourceData, meta interfac
return fmt.Errorf("error creating AppConfig Environment for Application (%s): empty response", appId)
}

d.Set("environment_id", environment.Id)
d.SetId(fmt.Sprintf("%s:%s", aws.StringValue(environment.Id), aws.StringValue(environment.ApplicationId)))

return resourceAwsAppconfigEnvironmentRead(d, meta)
Expand Down Expand Up @@ -148,6 +153,7 @@ func resourceAwsAppconfigEnvironmentRead(d *schema.ResourceData, meta interface{
}

d.Set("application_id", output.ApplicationId)
d.Set("environment_id", output.Id)
d.Set("description", output.Description)
d.Set("name", output.Name)
d.Set("state", output.State)
Expand Down
1 change: 1 addition & 0 deletions website/docs/r/appconfig_environment.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ In addition to all arguments above, the following attributes are exported:

* `arn` - The Amazon Resource Name (ARN) of the AppConfig Environment.
* `id` - The AppConfig environment ID and application ID separated by a colon (`:`).
* `environment_id` - The AppConfig environment ID.
* `tags_all` - A map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block).

## Import
Expand Down

0 comments on commit dc0ef30

Please sign in to comment.