Skip to content

Commit

Permalink
Add extra notes to critical resource properties (#4088)
Browse files Browse the repository at this point in the history
This pull request adds notes to docs that need a little bit of extra
information, according to customer engineering feedback.

Fixes #4067 

Fixes #4069
  • Loading branch information
guineveresaenger authored Jun 18, 2024
1 parent 9ecfa37 commit 384887b
Show file tree
Hide file tree
Showing 16 changed files with 91 additions and 64 deletions.
12 changes: 6 additions & 6 deletions provider/cmd/pulumi-resource-aws/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -186944,7 +186944,7 @@
},
"name": {
"type": "string",
"description": "The name for the public key. By default generated by this provider.\n"
"description": "The name for the public key. By default generated by this provider. Note: Do not set if using the key's id in another resource (e.g. KeyGroup) since it will result in a dependency error from AWS. 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"
},
"namePrefix": {
"type": "string",
Expand All @@ -186970,7 +186970,7 @@
},
"name": {
"type": "string",
"description": "The name for the public key. By default generated by this provider.\n",
"description": "The name for the public key. By default generated by this provider. Note: Do not set if using the key's id in another resource (e.g. KeyGroup) since it will result in a dependency error from AWS. 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",
"willReplaceOnChanges": true
},
"namePrefix": {
Expand Down Expand Up @@ -187004,7 +187004,7 @@
},
"name": {
"type": "string",
"description": "The name for the public key. By default generated by this provider.\n",
"description": "The name for the public key. By default generated by this provider. Note: Do not set if using the key's id in another resource (e.g. KeyGroup) since it will result in a dependency error from AWS. 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",
"willReplaceOnChanges": true
},
"namePrefix": {
Expand Down Expand Up @@ -236445,7 +236445,7 @@
"additionalProperties": {
"type": "string"
},
"description": "Map of arbitrary keys and values that, when changed, will trigger an in-place update (redeployment). Useful with `\"plantimestamp()\"`. See example above.\n"
"description": "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"
},
"volumeConfiguration": {
"$ref": "#/types/aws:ecs/ServiceVolumeConfiguration:ServiceVolumeConfiguration",
Expand Down Expand Up @@ -236595,7 +236595,7 @@
"additionalProperties": {
"type": "string"
},
"description": "Map of arbitrary keys and values that, when changed, will trigger an in-place update (redeployment). Useful with `\"plantimestamp()\"`. See example above.\n"
"description": "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"
},
"volumeConfiguration": {
"$ref": "#/types/aws:ecs/ServiceVolumeConfiguration:ServiceVolumeConfiguration",
Expand Down Expand Up @@ -236746,7 +236746,7 @@
"additionalProperties": {
"type": "string"
},
"description": "Map of arbitrary keys and values that, when changed, will trigger an in-place update (redeployment). Useful with `\"plantimestamp()\"`. See example above.\n"
"description": "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"
},
"volumeConfiguration": {
"$ref": "#/types/aws:ecs/ServiceVolumeConfiguration:ServiceVolumeConfiguration",
Expand Down
27 changes: 27 additions & 0 deletions provider/doc_edits.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ import (

func editRules(defaults []tfbridge.DocsEdit) []tfbridge.DocsEdit {
return append(defaults,
fixUpCloudFrontPublicKey,
fixUpEcsServiceName,
// This fixes up strings such as:
//
// name = "terraform-kinesis-firehose-os",
Expand Down Expand Up @@ -60,6 +62,31 @@ func simpleReplace(from, to string) tfbridge.DocsEdit {
}
}

func targetedSimpleReplace(filePath, from, to string) tfbridge.DocsEdit {
fromB, toB := []byte(from), []byte(to)
return tfbridge.DocsEdit{
Path: filePath,
Edit: func(_ string, content []byte) ([]byte, error) {
return bytes.ReplaceAll(content, fromB, toB), nil
},
}
}

var fixUpCloudFrontPublicKey = targetedSimpleReplace("cloudfront_public_key.html.markdown",
"* `name` - (Optional) The name for the public key. By default generated by this provider.",
"* `name` - (Optional) The name for the public key. By default generated by this provider. "+
"Note: Do not set if using the key's id in another resource (e.g. KeyGroup) "+
"since it will result in a dependency error from AWS. "+
"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",
"* `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")

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

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

6 changes: 3 additions & 3 deletions sdk/dotnet/Ecs/Service.cs

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

12 changes: 6 additions & 6 deletions sdk/go/aws/cloudfront/publicKey.go

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

Loading

0 comments on commit 384887b

Please sign in to comment.