Skip to content

Commit

Permalink
Merge pull request #20288 from hashicorp/b-appconfig-deployment
Browse files Browse the repository at this point in the history
r/appconfig_deployment: remove waiter since deployment time is configurable
  • Loading branch information
anGie44 authored Aug 17, 2021
2 parents 7953a87 + f34e114 commit 1039380
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 57 deletions.
7 changes: 7 additions & 0 deletions .changelog/20288.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
```release-note:bug
aws/resource_aws_appconfig_deployment: Remove internal waiter after start of deployment
```

```release-note:enhancement
aws/resource_aws_appconfig_deployment: Add `state` attribute
```
29 changes: 0 additions & 29 deletions aws/internal/service/appconfig/waiter/status.go

This file was deleted.

23 changes: 0 additions & 23 deletions aws/internal/service/appconfig/waiter/waiter.go

This file was deleted.

10 changes: 5 additions & 5 deletions aws/resource_aws_appconfig_deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
"github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags"
"github.com/terraform-providers/terraform-provider-aws/aws/internal/service/appconfig/waiter"
)

func resourceAwsAppconfigDeployment() *schema.Resource {
Expand Down Expand Up @@ -72,6 +71,10 @@ func resourceAwsAppconfigDeployment() *schema.Resource {
ForceNew: true,
ValidateFunc: validation.StringMatch(regexp.MustCompile(`[a-z0-9]{4,7}`), ""),
},
"state": {
Type: schema.TypeString,
Computed: true,
},
"tags": tagsSchema(),
"tags_all": tagsSchemaComputed(),
},
Expand Down Expand Up @@ -110,10 +113,6 @@ func resourceAwsAppconfigDeploymentCreate(d *schema.ResourceData, meta interface

d.SetId(fmt.Sprintf("%s/%s/%d", appID, envID, deployNum))

if err := waiter.DeploymentCreated(conn, appID, envID, deployNum); err != nil {
return fmt.Errorf("error waiting for AppConfig Deployment (%s) creation: %w", d.Id(), err)
}

return resourceAwsAppconfigDeploymentRead(d, meta)
}

Expand Down Expand Up @@ -166,6 +165,7 @@ func resourceAwsAppconfigDeploymentRead(d *schema.ResourceData, meta interface{}
d.Set("deployment_strategy_id", output.DeploymentStrategyId)
d.Set("description", output.Description)
d.Set("environment_id", output.EnvironmentId)
d.Set("state", output.State)

tags, err := keyvaluetags.AppconfigListTags(conn, arn)

Expand Down
1 change: 1 addition & 0 deletions aws/resource_aws_appconfig_deployment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ func TestAccAWSAppConfigDeployment_basic(t *testing.T) {
resource.TestCheckResourceAttrPair(resourceName, "deployment_strategy_id", depStrategyResourceName, "id"),
resource.TestCheckResourceAttr(resourceName, "description", rName),
resource.TestCheckResourceAttrPair(resourceName, "environment_id", envResourceName, "environment_id"),
resource.TestCheckResourceAttrSet(resourceName, "state"),
resource.TestCheckResourceAttr(resourceName, "tags.%", "0"),
),
},
Expand Down
1 change: 1 addition & 0 deletions website/docs/r/appconfig_deployment.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ In addition to all arguments above, the following attributes are exported:
* `id` - The AppConfig application ID, environment ID, and deployment number separated by a slash (`/`).
* `arn` - The Amazon Resource Name (ARN) of the AppConfig Deployment.
* `deployment_number` - The deployment number.
* `state` - The state of the deployment.
* `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 1039380

Please sign in to comment.