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

r/appconfig_deployment: remove waiter since deployment time is configurable #20288

Merged
merged 2 commits into from
Aug 17, 2021
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
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