-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
feat: add aws_appconfig_deployment #20172
feat: add aws_appconfig_deployment #20172
Conversation
This is still draft.
|
Hi @suzuki-shunsuke , thank you for this PR ! Since update is only supported for the resource tags, but not the other arguments, I would just add And then for the One additional thing to note is that it's possible for practitioners to hit a // in file aws/internal/service/appconfig/waiter.go
...
const DeploymentCreatedTimeout = 5 * time.Minute
func DeploymentCreated(conn *appconfig.AppConfig, appID, envID string, deployNum int64) error {
stateConf := &resource.StateChangeConf{
Pending: []string{appconfig.DeploymentStateBaking, appconfig.DeploymentStateRollingBack, appconfig.DeploymentStateValidating, appconfig.DeploymentStateDeploying},
Target: []string{appconfig.DeploymentStateComplete},
Refresh: DeploymentStatus(conn, appID, envID, deployNum),
Timeout: DeploymentCreatedTimeout,
}
_, err := stateConf.WaitForState()
return err
}
// in file aws/internal/service/appconfig/status.go
...
func DeploymentStatus(conn *appconfig.AppConfig, appID, envID string, deployNum int64) resource.StateRefreshFunc {
return func() (interface{}, string, error) {
input := &appconfig.GetDeploymentInput{
ApplicationId: aws.String(appID),
DeploymentNumber: aws.Int64(deployNum),
EnvironmentId: aws.String(envID),
}
output, err := conn.GetDeployment(input)
if err != nil {
return nil, "", err
}
if output == nil {
return nil, "", nil
}
return output, aws.StringValue(output.State), nil
}
}
// in aws/resource_aws_appconfig_deployment.go
...
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) Please reach out if you have any questions! |
Hi, @anGie44 |
AWS Go SDK pointer conversion function for `d.Set()` value is extraneous
I have implemented $ make testacc TESTARGS='-run=TestAccAWSAppConfigDeployment_basic'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSAppConfigDeployment_basic -timeout 180m
=== RUN TestAccAWSAppConfigDeployment_basic
=== PAUSE TestAccAWSAppConfigDeployment_basic
=== CONT TestAccAWSAppConfigDeployment_basic
--- PASS: TestAccAWSAppConfigDeployment_basic (53.01s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 55.031s |
I have a consideration about the waiter. In the code #20172 (comment) , the time is 5 minutes. |
Oh, I see. We have to run the waiter before creating the Deployment to wait for the previous version's Deployment. |
We have to list deployments and check the latest Deployment's status before starting Deployment. |
Hmm... https://awscli.amazonaws.com/v2/documentation/api/latest/reference/appconfig/list-deployments.html |
Or instead of checking the latest Deployment, we start Deployment and if |
Maybe the creation should not be retried but be failed immediately in case the other Deployment isn't finished. |
This reverts commit 7f4b6bc.
0834f15 Revert 7f4b6bc at once #20172 (comment) |
Thank you for this quick replies @suzuki-shunsuke ! I'll have a re-look at things today and get back to your comments above :) |
Hi @suzuki-shunsuke . so for the waiter functionality, that should occur right after calling Output of acceptance tests (commercial):
|
…verage, and update docs
This functionality has been released in v3.51.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
Thank you for your support and detailed explanation! const DeploymentCreatedTimeout = 20 * time.Minute I'll test the case it takes over 20 minutes to complement the deployment. resource "aws_appconfig_deployment_strategy" "test" {
name = "test-2"
deployment_duration_in_minutes = 25
final_bake_time_in_minutes = 25
growth_factor = 1.0
replicate_to = "NONE"
} |
It failed to run
|
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Community Note
Relates #11973
Output from acceptance testing:
Supports AppConfig Deployment.
AppConfig Deployment doesn't support common CRUD API.
Instead of common CRUD API, AppConfig Deployment supports the following API.
So I don't know how we should implement
Update
andDelete
.