Skip to content

Commit

Permalink
Correctly set the alt type for aws_cloudwatch_log_resource_policy
Browse files Browse the repository at this point in the history
This is a breaking change for Go and Typescript if users were reading the `PolicyDocument`
field on LogResourcePolicyArgs or on LogResourcePolicy.

This was discovered as part of
pulumi/pulumi-terraform-bridge#1758.
  • Loading branch information
iwahbe committed Mar 27, 2024
1 parent c3c2567 commit 37abf59
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 11 deletions.
18 changes: 18 additions & 0 deletions provider/cmd/pulumi-resource-aws/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -184553,6 +184553,15 @@
"inputProperties": {
"policyDocument": {
"type": "string",
"oneOf": [
{
"type": "string"
},
{
"type": "string",
"$ref": "#/types/aws:iam/documents:PolicyDocument"
}
],
"description": "Details of the resource policy, including the identity of the principal that is enabled to put logs to this account. This is formatted as a JSON string. Maximum length of 5120 characters.\n"
},
"policyName": {
Expand All @@ -184570,6 +184579,15 @@
"properties": {
"policyDocument": {
"type": "string",
"oneOf": [
{
"type": "string"
},
{
"type": "string",
"$ref": "#/types/aws:iam/documents:PolicyDocument"
}
],
"description": "Details of the resource policy, including the identity of the principal that is enabled to put logs to this account. This is formatted as a JSON string. Maximum length of 5120 characters.\n"
},
"policyName": {
Expand Down
8 changes: 3 additions & 5 deletions provider/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -1335,11 +1335,9 @@ func ProviderFromMeta(metaInfo *tfbridge.MetadataInfo) *tfbridge.ProviderInfo {
Tok: awsResource(cloudwatchMod, "LogResourcePolicy"),
Fields: map[string]*tfbridge.SchemaInfo{
"policy_document": {
Elem: &tfbridge.SchemaInfo{
Type: "string",
AltTypes: []tokens.Type{awsType(iamMod, "documents", "PolicyDocument")},
Transform: tfbridge.TransformJSONDocument,
},
Type: "string",
AltTypes: []tokens.Type{awsType(iamMod, "documents", "PolicyDocument")},
Transform: tfbridge.TransformJSONDocument,
},
},
},
Expand Down
8 changes: 4 additions & 4 deletions sdk/go/aws/cloudwatch/logResourcePolicy.go

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

6 changes: 4 additions & 2 deletions sdk/nodejs/cloudwatch/logResourcePolicy.ts

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

0 comments on commit 37abf59

Please sign in to comment.