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

Correctly set the alt type for aws_cloudwatch_log_resource_policy #3743

Merged

Conversation

iwahbe
Copy link
Member

@iwahbe iwahbe commented Mar 27, 2024

This is a breaking change for Go and Typescript if users were reading the PolicyDocument field on LogResourcePolicyArgs or on LogResourcePolicy. If we don't want to take the change, we can remove the override entirely (semantically equivalent to what we have now in master).

This was discovered as part of pulumi/pulumi-terraform-bridge#1758.

- `aws_cloudwatch_log_resource_policy.policy_document`
- `aws_ecr_registry_policy.policy`
- `aws_sns_topic_policy.policy`

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.
@iwahbe iwahbe force-pushed the iwahbe/cloudwatch-log-resource-policy-correctly-apply-alt-type branch from 37abf59 to 86621a5 Compare March 27, 2024 17:12
@@ -150,13 +150,13 @@ func (RegistryPolicyState) ElementType() reflect.Type {

type registryPolicyArgs struct {
// The policy document. This is a JSON formatted string.
Policy string `pulumi:"policy"`
Policy interface{} `pulumi:"policy"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is exactly breaking as it interface{} slot would still accept string, right? So earlier programs likely still continue working.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you write to RegistryPolicyArgs.Policy, it is not breaking. If you read from RegistryPolicyArgs.Policy, then it is breaking. I believe that writes are the common case, but you can read from args.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah .. I think so. We haven't discussed how strict we want to be here, but I think we shouldn't count these changes as breaking IMO.

@t0yv0
Copy link
Member

t0yv0 commented Mar 27, 2024

I'd be fine with merging because I think it won't break 99.9% of programs, curious on what @corymhall thinks. There is something really improving here for TypeScript users but not so much for Go, Go decides to emit interface{} and the typed version of the input is not discoverable.

@t0yv0
Copy link
Member

t0yv0 commented Mar 27, 2024

Filed p/p enhancement around Go support.

Copy link

Does the PR have any schema changes?

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

Maintainer note: consult the runbook for dealing with any breaking changes.

Copy link

Is README.md missing any configuration options?

assumeRoleWithWebIdentity not found in Configuration section
customCaBundle not found in Configuration section
defaultTags not found in Configuration section
ec2MetadataServiceEndpoint not found in Configuration section
ec2MetadataServiceEndpointMode not found in Configuration section
httpProxy not found in Configuration section
httpsProxy not found in Configuration section
ignoreTags not found in Configuration section
noProxy not found in Configuration section
retryMode not found in Configuration section
s3UsEast1RegionalEndpoint not found in Configuration section
sharedConfigFiles not found in Configuration section
skipRequestingAccountId not found in Configuration section
stsRegion not found in Configuration section
tokenBucketRateLimiterCapacity not found in Configuration section
useDualstackEndpoint not found in Configuration section

Please add a description for each of these options to README.md. Details about them can be found in either the upstream docs or schema.json.

@t0yv0 t0yv0 self-requested a review March 27, 2024 18:09
@iwahbe iwahbe merged commit 60ee1d9 into master Mar 28, 2024
23 checks passed
@iwahbe iwahbe deleted the iwahbe/cloudwatch-log-resource-policy-correctly-apply-alt-type branch March 28, 2024 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants