Skip to content

Commit

Permalink
WIP: fix(ecsservice): triggers required when using forceNewDeployment (
Browse files Browse the repository at this point in the history
…#4262)

There is a note saying you need to set `forceNewDeployment` when adding
`triggers`.
The reverse is also true, so adding a note to say that `triggers` are
required when adding `forceNewDeployment`.

---------

Co-authored-by: Florian Stadler <[email protected]>
  • Loading branch information
stooj and flostadler committed Aug 22, 2024
1 parent f437d24 commit bde3081
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 5 deletions.
6 changes: 3 additions & 3 deletions provider/cmd/pulumi-resource-aws/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -246624,7 +246624,7 @@
},
"forceNewDeployment": {
"type": "boolean",
"description": "Enable to force a new task deployment of the service. This can be used to update tasks to use a newer Docker image with same image/tag combination (e.g., `myimage:latest`), roll Fargate tasks onto a newer platform version, or immediately deploy `ordered_placement_strategy` and `placement_constraints` updates.\n"
"description": "Enable to force a new task deployment of the service. This can be used to update tasks to use a newer Docker image with same image/tag combination (e.g., `myimage:latest`), roll Fargate tasks onto a newer platform version, or immediately deploy `ordered_placement_strategy` and `placement_constraints` updates.\nWhen using the forceNewDeployment property you also need to configure the triggers property.\n"
},
"healthCheckGracePeriodSeconds": {
"type": "integer",
Expand Down Expand Up @@ -246782,7 +246782,7 @@
},
"forceNewDeployment": {
"type": "boolean",
"description": "Enable to force a new task deployment of the service. This can be used to update tasks to use a newer Docker image with same image/tag combination (e.g., `myimage:latest`), roll Fargate tasks onto a newer platform version, or immediately deploy `ordered_placement_strategy` and `placement_constraints` updates.\n"
"description": "Enable to force a new task deployment of the service. This can be used to update tasks to use a newer Docker image with same image/tag combination (e.g., `myimage:latest`), roll Fargate tasks onto a newer platform version, or immediately deploy `ordered_placement_strategy` and `placement_constraints` updates.\nWhen using the forceNewDeployment property you also need to configure the triggers property.\n"
},
"healthCheckGracePeriodSeconds": {
"type": "integer",
Expand Down Expand Up @@ -246929,7 +246929,7 @@
},
"forceNewDeployment": {
"type": "boolean",
"description": "Enable to force a new task deployment of the service. This can be used to update tasks to use a newer Docker image with same image/tag combination (e.g., `myimage:latest`), roll Fargate tasks onto a newer platform version, or immediately deploy `ordered_placement_strategy` and `placement_constraints` updates.\n"
"description": "Enable to force a new task deployment of the service. This can be used to update tasks to use a newer Docker image with same image/tag combination (e.g., `myimage:latest`), roll Fargate tasks onto a newer platform version, or immediately deploy `ordered_placement_strategy` and `placement_constraints` updates.\nWhen using the forceNewDeployment property you also need to configure the triggers property.\n"
},
"healthCheckGracePeriodSeconds": {
"type": "integer",
Expand Down
17 changes: 15 additions & 2 deletions provider/doc_edits.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ import (
func editRules(defaults []tfbridge.DocsEdit) []tfbridge.DocsEdit {
return append(defaults,
fixUpCloudFrontPublicKey,
fixUpEcsServiceName,
fixUpEcsServiceNameTrigger,
fixUpEcsServiceNameForceNewDeployment,
// This fixes up strings such as:
//
// name = "terraform-kinesis-firehose-os",
Expand Down Expand Up @@ -80,13 +81,25 @@ var fixUpCloudFrontPublicKey = targetedSimpleReplace("cloudfront_public_key.html
"Instead, it is recommended to use Pulumi autonaming by leaving this property unset (default behavior) "+
"or set the `namePrefix` property to allow the provider to autoname the resource.\n")

var fixUpEcsServiceName = targetedSimpleReplace("ecs_service.html.markdown",
var fixUpEcsServiceNameTrigger = targetedSimpleReplace("ecs_service.html.markdown",
"* `triggers` - (Optional) Map of arbitrary keys and values that, when changed, will trigger "+
"an in-place update (redeployment). Useful with `plantimestamp()`. See example above.\n",
"* `triggers` - (Optional) Map of arbitrary keys and values that, when changed, will trigger "+
"an in-place update (redeployment). Useful with `plantimestamp()`. "+
"When using the triggers property you also need to set the forceNewDeployment property to True.\n")

var fixUpEcsServiceNameForceNewDeployment = targetedSimpleReplace(
"ecs_service.html.markdown",
"* `force_new_deployment` - (Optional) Enable to force a new task deployment of the service. "+
"This can be used to update tasks to use a newer Docker image with same image/tag combination "+
"(e.g., `myimage:latest`), roll Fargate tasks onto a newer platform version, or immediately deploy "+
"`ordered_placement_strategy` and `placement_constraints` updates.",
"* `force_new_deployment` - (Optional) Enable to force a new task deployment of the service. "+
"This can be used to update tasks to use a newer Docker image with same image/tag combination "+
"(e.g., `myimage:latest`), roll Fargate tasks onto a newer platform version, or immediately deploy "+
"`ordered_placement_strategy` and `placement_constraints` updates.\n"+
"When using the forceNewDeployment property you also need to configure the triggers property.\n")

func reReplace(from string, to string) tfbridge.DocsEdit {
fromR, toB := regexp.MustCompile(from), []byte(to)
return tfbridge.DocsEdit{
Expand Down
3 changes: 3 additions & 0 deletions sdk/dotnet/Ecs/Service.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions sdk/go/aws/ecs/service.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions sdk/java/src/main/java/com/pulumi/aws/ecs/Service.java

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions sdk/java/src/main/java/com/pulumi/aws/ecs/ServiceArgs.java

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit bde3081

Please sign in to comment.