Trying to make an SNS Topic, and encountering an e...
# aws
Trying to make an SNS Topic, and encountering an error on a pretty basic innstance, in US Gov. Interesting the same code in Terraform works. Same region, us-gov-west-1, aws-us-gov partition.
Copy code
test_topic = aws.sns.Topic("test_tjf_1")
Copy code
resource "aws_sns_topic" "tjf_test_1" {
  name = "tjf-test-1"
Copy code
Updating (prd):
     Type                 Name                Status                  Info
     pulumi:pulumi:Stack  aws-cloudwatch-prd  **failed**              1 error
 +   └─ aws:sns:Topic     test_tjf_1          **creating failed**     1 error

  pulumi:pulumi:Stack (aws-cloudwatch-prd):
    error: update failed

  aws:sns:Topic (test_tjf_1):
    error: 1 error occurred:
        * operation error SNS: GetTopicAttributes, https response error StatusCode: 400, RequestID: <REDACTED>, InvalidParameter: Invalid parameter: TopicArn Reason: A us-gov-west-1 ARN must begin with arn:aws-us-gov, not arn:aws:sns:us-gov-west-1:<REDACTED>:test_tjf_1-0c5bb96
This feels like a conversion error from the tf bridge when trying to locate the AttrARN and making an assumption with the arn construction but I can't seem to locate where it builds this...
something tells me this is the offender...I don't know what these patches do, but they affect the tf bridge generator I'm sure
@enough-garden-22763 looks like you're a committer here (not sure if you know how this file works)
It's unsafe to assume that policy ARNS can ever be generated without that being a passed in option... other partitions (like China, or US Gov) .. this breaks.
File an issue please? The team will have a look.
Quite possibly you're correct, this might be hitting this branch where it shouldn't
Copy code
+	if !tfresource.NotFound(err) {
+		return diag.FromErr(err)
+	}
Since constructTopicArn is malformed.
Thank you!
Yeah so this is one of those weird edge cases in the upstream provider where the arn field gets set so it can subsequently create an implicit policy for the topic (I think?) and in Terraform it works, but if the conversion requires change here, that hard-coded ARN template breaks in the non commercial partition.. I don't know how TF got this info dynamically, but it does work on those providers..
This is sort of a blocker, for us anyway, to being able to utilize this feature of Pulumi. I'm sure this is affecting any customers who use China cloud too
It's going to get looked quickly, marked as P1.
Apologize for the disruption.
No worries! much appreciate the discuss here. 🙏
Random thought I am not familiar with Golang's AWS SDK, but I would think that the partition is available via the SNSClient/AWSClient resource so might not even need new param on this method.
@gorgeous-minister-41131 can you try and see if this is resolved, much appreciated!
Yup one of our team mates is going to be giving it a try in a bit.