diff --git a/examples/go.mod b/examples/go.mod index 6891b4f01bf..3322f25adc1 100644 --- a/examples/go.mod +++ b/examples/go.mod @@ -285,10 +285,10 @@ require ( github.com/pkg/term v1.1.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/pulumi/appdash v0.0.0-20231130102222-75f619a67231 // indirect - github.com/pulumi/esc v0.6.1 // indirect + github.com/pulumi/esc v0.6.2 // indirect github.com/pulumi/pulumi-terraform-bridge/v3 v3.69.0 // indirect github.com/pulumi/pulumi-terraform-bridge/x/muxer v0.0.7-0.20231130182140-6385710fcbc4 // indirect - github.com/pulumi/pulumi/sdk/v3 v3.98.0 // indirect + github.com/pulumi/pulumi/sdk/v3 v3.99.0 // indirect github.com/pulumi/terraform-diff-reader v0.0.2 // indirect github.com/rivo/uniseg v0.4.4 // indirect github.com/rogpeppe/go-internal v1.11.0 // indirect @@ -347,3 +347,7 @@ require ( gopkg.in/yaml.v3 v3.0.1 // indirect lukechampine.com/frand v1.4.2 // indirect ) + +replace github.com/pulumi/pulumi/pkg/v3 => github.com/pulumi/pulumi/pkg/v3 v3.78.2-0.20231225021323-11f3fe2b2a73 + +replace github.com/pulumi/pulumi/sdk/v3 => github.com/pulumi/pulumi/sdk/v3 v3.99.1-0.20231225021323-11f3fe2b2a73 diff --git a/examples/go.sum b/examples/go.sum index f84dd152525..f5a43c9bb94 100644 --- a/examples/go.sum +++ b/examples/go.sum @@ -2401,8 +2401,8 @@ github.com/prometheus/prometheus v0.37.0/go.mod h1:egARUgz+K93zwqsVIAneFlLZefyGO github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/pulumi/appdash v0.0.0-20231130102222-75f619a67231 h1:vkHw5I/plNdTr435cARxCW6q9gc0S/Yxz7Mkd38pOb0= github.com/pulumi/appdash v0.0.0-20231130102222-75f619a67231/go.mod h1:murToZ2N9hNJzewjHBgfFdXhZKjY3z5cYC1VXk+lbFE= -github.com/pulumi/esc v0.6.1 h1:X6gRcw1cH/oNkZG8MuD4rUhetO7fUTGKZXPzQWAPX40= -github.com/pulumi/esc v0.6.1/go.mod h1:1+tlMNX29iqfyElwo0tc2eRx9MWjWHRjrPLyLvTQMqM= +github.com/pulumi/esc v0.6.2 h1:+z+l8cuwIauLSwXQS0uoI3rqB+YG4SzsZYtHfNoXBvw= +github.com/pulumi/esc v0.6.2/go.mod h1:jNnYNjzsOgVTjCp0LL24NsCk8ZJxq4IoLQdCT0X7l8k= github.com/pulumi/providertest v0.0.3 h1:DLcAvVGgeP4mHEi1Ftk5zTX9QHjcrO6u5w5GCZrF99s= github.com/pulumi/providertest v0.0.3/go.mod h1:kZYBA14iemv3X4G4xsBKaa72zVbn//IyL5HTYKpLuy0= github.com/pulumi/pulumi-terraform-bridge/pf v0.22.0 h1:sgQslsC7PqYh3Flxk3bZhXc3DNLiYUmxUTBogR0l46w= @@ -2413,10 +2413,10 @@ github.com/pulumi/pulumi-terraform-bridge/v3 v3.69.0 h1:PsIB738ZqrQbHKe5Q5Ag8Kq/ github.com/pulumi/pulumi-terraform-bridge/v3 v3.69.0/go.mod h1:/wXhD95iSr4FlmGtVN/H8hXriMW4isDDrAUprozXG4A= github.com/pulumi/pulumi-terraform-bridge/x/muxer v0.0.7-0.20231130182140-6385710fcbc4 h1:8lK+vlRrnAxB6K3J2YIPAq50ETpvvWZ92vi66Hko/4o= github.com/pulumi/pulumi-terraform-bridge/x/muxer v0.0.7-0.20231130182140-6385710fcbc4/go.mod h1:F/fzVS4Ksc4SPPLtMjGFRM9M76QtM1Rc0CYGnHCHEwU= -github.com/pulumi/pulumi/pkg/v3 v3.98.0 h1:lQyjy31az5bMfTmsyqeeAEQMKjrLyx8IL+C27D6b+x4= -github.com/pulumi/pulumi/pkg/v3 v3.98.0/go.mod h1:aeQmrCMwvMOIz1s6qOk+vg1oCWff5hmeRrg1vYv8eRU= -github.com/pulumi/pulumi/sdk/v3 v3.98.0 h1:H18eCWKiv7oXy7n/dni3JxFfwvY3UEjAzjeqtaaZT+I= -github.com/pulumi/pulumi/sdk/v3 v3.98.0/go.mod h1:/bHwzPhsCJCjzY0STmvZ7DzV5gZN6iDSXQ/gitEAyws= +github.com/pulumi/pulumi/pkg/v3 v3.78.2-0.20231225021323-11f3fe2b2a73 h1:Ks+E1DTJuwYFNKsgxNP16aqZS7esCdo2z9wx9hTUuFo= +github.com/pulumi/pulumi/pkg/v3 v3.78.2-0.20231225021323-11f3fe2b2a73/go.mod h1:Gk/N8qblqKI6+fTORH7oJi2SSWaOVTDhNwTrazoQPao= +github.com/pulumi/pulumi/sdk/v3 v3.99.1-0.20231225021323-11f3fe2b2a73 h1:0SXeZJ8WbMhQWYe5ULG0OT7SwfY53wyx13tBQ6975R4= +github.com/pulumi/pulumi/sdk/v3 v3.99.1-0.20231225021323-11f3fe2b2a73/go.mod h1:wFM/6iAMlidgLDSF9QU+p3P+B+vg/xloFyVeZrVwA1w= github.com/pulumi/terraform-diff-reader v0.0.2 h1:kTE4nEXU3/SYXESvAIem+wyHMI3abqkI3OhJ0G04LLI= github.com/pulumi/terraform-diff-reader v0.0.2/go.mod h1:sZ9FUzGO+yM41hsQHs/yIcj/Y993qMdBxBU5mpDmAfQ= github.com/pulumi/terraform-plugin-sdk/v2 v2.0.0-20230912190043-e6d96b3b8f7e h1:blSirnXqvm8JXLxwxelsBroUNRhOHakDO7cgJUYTdpQ= diff --git a/provider/cmd/pulumi-resource-aws/schema.json b/provider/cmd/pulumi-resource-aws/schema.json index 292338d5e10..346460c5332 100644 --- a/provider/cmd/pulumi-resource-aws/schema.json +++ b/provider/cmd/pulumi-resource-aws/schema.json @@ -292722,7 +292722,7 @@ } }, "aws:s3control/multiRegionAccessPointPolicy:MultiRegionAccessPointPolicy": { - "description": "Provides a resource to manage an S3 Multi-Region Access Point access control policy.\n\n{{% examples %}}\n## Example Usage\n{{% example %}}\n### Basic Example\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as aws from \"@pulumi/aws\";\n\nconst currentCallerIdentity = aws.getCallerIdentity({});\nconst currentPartition = aws.getPartition({});\nconst fooBucket = new aws.s3.BucketV2(\"fooBucket\", {});\nconst exampleMultiRegionAccessPoint = new aws.s3control.MultiRegionAccessPoint(\"exampleMultiRegionAccessPoint\", {details: {\n name: \"example\",\n regions: [{\n bucket: fooBucket.id,\n }],\n}});\nconst exampleMultiRegionAccessPointPolicy = new aws.s3control.MultiRegionAccessPointPolicy(\"exampleMultiRegionAccessPointPolicy\", {details: {\n name: exampleMultiRegionAccessPoint.id.apply(id =\u003e id.split(\":\"))[1],\n policy: pulumi.all([currentCallerIdentity, currentPartition, currentCallerIdentity, exampleMultiRegionAccessPoint.alias]).apply(([currentCallerIdentity, currentPartition, currentCallerIdentity1, alias]) =\u003e JSON.stringify({\n Version: \"2012-10-17\",\n Statement: [{\n Sid: \"Example\",\n Effect: \"Allow\",\n Principal: {\n AWS: currentCallerIdentity.accountId,\n },\n Action: [\n \"s3:GetObject\",\n \"s3:PutObject\",\n ],\n Resource: `arn:${currentPartition.partition}:s3::${currentCallerIdentity1.accountId}:accesspoint/${alias}/object/*`,\n }],\n })),\n}});\n```\n```python\nimport pulumi\nimport json\nimport pulumi_aws as aws\n\ncurrent_caller_identity = aws.get_caller_identity()\ncurrent_partition = aws.get_partition()\nfoo_bucket = aws.s3.BucketV2(\"fooBucket\")\nexample_multi_region_access_point = aws.s3control.MultiRegionAccessPoint(\"exampleMultiRegionAccessPoint\", details=aws.s3control.MultiRegionAccessPointDetailsArgs(\n name=\"example\",\n regions=[aws.s3control.MultiRegionAccessPointDetailsRegionArgs(\n bucket=foo_bucket.id,\n )],\n))\nexample_multi_region_access_point_policy = aws.s3control.MultiRegionAccessPointPolicy(\"exampleMultiRegionAccessPointPolicy\", details=aws.s3control.MultiRegionAccessPointPolicyDetailsArgs(\n name=example_multi_region_access_point.id.apply(lambda id: id.split(\":\"))[1],\n policy=example_multi_region_access_point.alias.apply(lambda alias: json.dumps({\n \"Version\": \"2012-10-17\",\n \"Statement\": [{\n \"Sid\": \"Example\",\n \"Effect\": \"Allow\",\n \"Principal\": {\n \"AWS\": current_caller_identity.account_id,\n },\n \"Action\": [\n \"s3:GetObject\",\n \"s3:PutObject\",\n ],\n \"Resource\": f\"arn:{current_partition.partition}:s3::{current_caller_identity.account_id}:accesspoint/{alias}/object/*\",\n }],\n })),\n))\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text.Json;\nusing Pulumi;\nusing Aws = Pulumi.Aws;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var currentCallerIdentity = Aws.GetCallerIdentity.Invoke();\n\n var currentPartition = Aws.GetPartition.Invoke();\n\n var fooBucket = new Aws.S3.BucketV2(\"fooBucket\");\n\n var exampleMultiRegionAccessPoint = new Aws.S3Control.MultiRegionAccessPoint(\"exampleMultiRegionAccessPoint\", new()\n {\n Details = new Aws.S3Control.Inputs.MultiRegionAccessPointDetailsArgs\n {\n Name = \"example\",\n Regions = new[]\n {\n new Aws.S3Control.Inputs.MultiRegionAccessPointDetailsRegionArgs\n {\n Bucket = fooBucket.Id,\n },\n },\n },\n });\n\n var exampleMultiRegionAccessPointPolicy = new Aws.S3Control.MultiRegionAccessPointPolicy(\"exampleMultiRegionAccessPointPolicy\", new()\n {\n Details = new Aws.S3Control.Inputs.MultiRegionAccessPointPolicyDetailsArgs\n {\n Name = exampleMultiRegionAccessPoint.Id.Apply(id =\u003e id.Split(\":\"))[1],\n Policy = Output.Tuple(currentCallerIdentity, currentPartition, currentCallerIdentity, exampleMultiRegionAccessPoint.Alias).Apply(values =\u003e\n {\n var currentCallerIdentity = values.Item1;\n var currentPartition = values.Item2;\n var currentCallerIdentity1 = values.Item3;\n var @alias = values.Item4;\n return JsonSerializer.Serialize(new Dictionary\u003cstring, object?\u003e\n {\n [\"Version\"] = \"2012-10-17\",\n [\"Statement\"] = new[]\n {\n new Dictionary\u003cstring, object?\u003e\n {\n [\"Sid\"] = \"Example\",\n [\"Effect\"] = \"Allow\",\n [\"Principal\"] = new Dictionary\u003cstring, object?\u003e\n {\n [\"AWS\"] = currentCallerIdentity.Apply(getCallerIdentityResult =\u003e getCallerIdentityResult.AccountId),\n },\n [\"Action\"] = new[]\n {\n \"s3:GetObject\",\n \"s3:PutObject\",\n },\n [\"Resource\"] = $\"arn:{currentPartition.Apply(getPartitionResult =\u003e getPartitionResult.Partition)}:s3::{currentCallerIdentity1.AccountId}:accesspoint/{@alias}/object/*\",\n },\n },\n });\n }),\n },\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\n\t\"github.com/pulumi/pulumi-aws/sdk/v6/go/aws\"\n\t\"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/s3\"\n\t\"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/s3control\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\tcurrentCallerIdentity, err := aws.GetCallerIdentity(ctx, nil, nil)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcurrentPartition, err := aws.GetPartition(ctx, nil, nil)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfooBucket, err := s3.NewBucketV2(ctx, \"fooBucket\", nil)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\texampleMultiRegionAccessPoint, err := s3control.NewMultiRegionAccessPoint(ctx, \"exampleMultiRegionAccessPoint\", \u0026s3control.MultiRegionAccessPointArgs{\n\t\t\tDetails: \u0026s3control.MultiRegionAccessPointDetailsArgs{\n\t\t\t\tName: pulumi.String(\"example\"),\n\t\t\t\tRegions: s3control.MultiRegionAccessPointDetailsRegionArray{\n\t\t\t\t\t\u0026s3control.MultiRegionAccessPointDetailsRegionArgs{\n\t\t\t\t\t\tBucket: fooBucket.ID(),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = s3control.NewMultiRegionAccessPointPolicy(ctx, \"exampleMultiRegionAccessPointPolicy\", \u0026s3control.MultiRegionAccessPointPolicyArgs{\n\t\t\tDetails: \u0026s3control.MultiRegionAccessPointPolicyDetailsArgs{\n\t\t\t\tName: \"TODO: element\",\n\t\t\t\tPolicy: exampleMultiRegionAccessPoint.Alias.ApplyT(func(alias string) (pulumi.String, error) {\n\t\t\t\t\tvar _zero pulumi.String\n\t\t\t\t\ttmpJSON0, err := json.Marshal(map[string]interface{}{\n\t\t\t\t\t\t\"Version\": \"2012-10-17\",\n\t\t\t\t\t\t\"Statement\": []map[string]interface{}{\n\t\t\t\t\t\t\tmap[string]interface{}{\n\t\t\t\t\t\t\t\t\"Sid\": \"Example\",\n\t\t\t\t\t\t\t\t\"Effect\": \"Allow\",\n\t\t\t\t\t\t\t\t\"Principal\": map[string]interface{}{\n\t\t\t\t\t\t\t\t\t\"AWS\": currentCallerIdentity.AccountId,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\"Action\": []string{\n\t\t\t\t\t\t\t\t\t\"s3:GetObject\",\n\t\t\t\t\t\t\t\t\t\"s3:PutObject\",\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\"Resource\": fmt.Sprintf(\"arn:%v:s3::%v:accesspoint/%v/object/*\", currentPartition.Partition, currentCallerIdentity.AccountId, alias),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t})\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn _zero, err\n\t\t\t\t\t}\n\t\t\t\t\tjson0 := string(tmpJSON0)\n\t\t\t\t\treturn pulumi.String(json0), nil\n\t\t\t\t}).(pulumi.StringOutput),\n\t\t\t},\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.aws.AwsFunctions;\nimport com.pulumi.aws.inputs.GetCallerIdentityArgs;\nimport com.pulumi.aws.inputs.GetPartitionArgs;\nimport com.pulumi.aws.s3.BucketV2;\nimport com.pulumi.aws.s3control.MultiRegionAccessPoint;\nimport com.pulumi.aws.s3control.MultiRegionAccessPointArgs;\nimport com.pulumi.aws.s3control.inputs.MultiRegionAccessPointDetailsArgs;\nimport com.pulumi.aws.s3control.MultiRegionAccessPointPolicy;\nimport com.pulumi.aws.s3control.MultiRegionAccessPointPolicyArgs;\nimport com.pulumi.aws.s3control.inputs.MultiRegionAccessPointPolicyDetailsArgs;\nimport static com.pulumi.codegen.internal.Serialization.*;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n final var currentCallerIdentity = AwsFunctions.getCallerIdentity();\n\n final var currentPartition = AwsFunctions.getPartition();\n\n var fooBucket = new BucketV2(\"fooBucket\");\n\n var exampleMultiRegionAccessPoint = new MultiRegionAccessPoint(\"exampleMultiRegionAccessPoint\", MultiRegionAccessPointArgs.builder() \n .details(MultiRegionAccessPointDetailsArgs.builder()\n .name(\"example\")\n .regions(MultiRegionAccessPointDetailsRegionArgs.builder()\n .bucket(fooBucket.id())\n .build())\n .build())\n .build());\n\n var exampleMultiRegionAccessPointPolicy = new MultiRegionAccessPointPolicy(\"exampleMultiRegionAccessPointPolicy\", MultiRegionAccessPointPolicyArgs.builder() \n .details(MultiRegionAccessPointPolicyDetailsArgs.builder()\n .name(exampleMultiRegionAccessPoint.id().applyValue(id -\u003e id.split(\":\"))[1])\n .policy(exampleMultiRegionAccessPoint.alias().applyValue(alias -\u003e serializeJson(\n jsonObject(\n jsonProperty(\"Version\", \"2012-10-17\"),\n jsonProperty(\"Statement\", jsonArray(jsonObject(\n jsonProperty(\"Sid\", \"Example\"),\n jsonProperty(\"Effect\", \"Allow\"),\n jsonProperty(\"Principal\", jsonObject(\n jsonProperty(\"AWS\", currentCallerIdentity.applyValue(getCallerIdentityResult -\u003e getCallerIdentityResult.accountId()))\n )),\n jsonProperty(\"Action\", jsonArray(\n \"s3:GetObject\", \n \"s3:PutObject\"\n )),\n jsonProperty(\"Resource\", String.format(\"arn:%s:s3::%s:accesspoint/%s/object/*\", currentPartition.applyValue(getPartitionResult -\u003e getPartitionResult.partition()),currentCallerIdentity.applyValue(getCallerIdentityResult -\u003e getCallerIdentityResult.accountId()),alias))\n )))\n ))))\n .build())\n .build());\n\n }\n}\n```\n```yaml\nresources:\n fooBucket:\n type: aws:s3:BucketV2\n exampleMultiRegionAccessPoint:\n type: aws:s3control:MultiRegionAccessPoint\n properties:\n details:\n name: example\n regions:\n - bucket: ${fooBucket.id}\n exampleMultiRegionAccessPointPolicy:\n type: aws:s3control:MultiRegionAccessPointPolicy\n properties:\n details:\n name:\n fn::select:\n - 1\n - fn::split:\n - ${exampleMultiRegionAccessPoint.id}\n - ':'\n policy:\n fn::toJSON:\n Version: 2012-10-17\n Statement:\n - Sid: Example\n Effect: Allow\n Principal:\n AWS: ${currentCallerIdentity.accountId}\n Action:\n - s3:GetObject\n - s3:PutObject\n Resource: arn:${currentPartition.partition}:s3::${currentCallerIdentity.accountId}:accesspoint/${exampleMultiRegionAccessPoint.alias}/object/*\nvariables:\n currentCallerIdentity:\n fn::invoke:\n Function: aws:getCallerIdentity\n Arguments: {}\n currentPartition:\n fn::invoke:\n Function: aws:getPartition\n Arguments: {}\n```\n{{% /example %}}\n{{% /examples %}}\n\n## Import\n\nUsing `pulumi import`, import Multi-Region Access Point Policies using the `account_id` and `name` of the Multi-Region Access Point separated by a colon (`:`). For example:\n\n```sh\n $ pulumi import aws:s3control/multiRegionAccessPointPolicy:MultiRegionAccessPointPolicy example 123456789012:example\n```\n ", + "description": "Provides a resource to manage an S3 Multi-Region Access Point access control policy.\n\n{{% examples %}}\n## Example Usage\n{{% example %}}\n### Basic Example\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as aws from \"@pulumi/aws\";\n\nconst currentCallerIdentity = aws.getCallerIdentity({});\nconst currentPartition = aws.getPartition({});\nconst fooBucket = new aws.s3.BucketV2(\"fooBucket\", {});\nconst exampleMultiRegionAccessPoint = new aws.s3control.MultiRegionAccessPoint(\"exampleMultiRegionAccessPoint\", {details: {\n name: \"example\",\n regions: [{\n bucket: fooBucket.id,\n }],\n}});\nconst exampleMultiRegionAccessPointPolicy = new aws.s3control.MultiRegionAccessPointPolicy(\"exampleMultiRegionAccessPointPolicy\", {details: {\n name: exampleMultiRegionAccessPoint.id.apply(id =\u003e id.split(\":\"))[1],\n policy: pulumi.all([currentCallerIdentity, currentPartition, currentCallerIdentity, exampleMultiRegionAccessPoint.alias]).apply(([currentCallerIdentity, currentPartition, currentCallerIdentity1, alias]) =\u003e JSON.stringify({\n Version: \"2012-10-17\",\n Statement: [{\n Sid: \"Example\",\n Effect: \"Allow\",\n Principal: {\n AWS: currentCallerIdentity.accountId,\n },\n Action: [\n \"s3:GetObject\",\n \"s3:PutObject\",\n ],\n Resource: `arn:${currentPartition.partition}:s3::${currentCallerIdentity1.accountId}:accesspoint/${alias}/object/*`,\n }],\n })),\n}});\n```\n```python\nimport pulumi\nimport json\nimport pulumi_aws as aws\n\ncurrent_caller_identity = aws.get_caller_identity()\ncurrent_partition = aws.get_partition()\nfoo_bucket = aws.s3.BucketV2(\"fooBucket\")\nexample_multi_region_access_point = aws.s3control.MultiRegionAccessPoint(\"exampleMultiRegionAccessPoint\", details=aws.s3control.MultiRegionAccessPointDetailsArgs(\n name=\"example\",\n regions=[aws.s3control.MultiRegionAccessPointDetailsRegionArgs(\n bucket=foo_bucket.id,\n )],\n))\nexample_multi_region_access_point_policy = aws.s3control.MultiRegionAccessPointPolicy(\"exampleMultiRegionAccessPointPolicy\", details=aws.s3control.MultiRegionAccessPointPolicyDetailsArgs(\n name=example_multi_region_access_point.id.apply(lambda id: id.split(\":\"))[1],\n policy=example_multi_region_access_point.alias.apply(lambda alias: json.dumps({\n \"Version\": \"2012-10-17\",\n \"Statement\": [{\n \"Sid\": \"Example\",\n \"Effect\": \"Allow\",\n \"Principal\": {\n \"AWS\": current_caller_identity.account_id,\n },\n \"Action\": [\n \"s3:GetObject\",\n \"s3:PutObject\",\n ],\n \"Resource\": f\"arn:{current_partition.partition}:s3::{current_caller_identity.account_id}:accesspoint/{alias}/object/*\",\n }],\n })),\n))\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text.Json;\nusing Pulumi;\nusing Aws = Pulumi.Aws;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var currentCallerIdentity = Aws.GetCallerIdentity.Invoke();\n\n var currentPartition = Aws.GetPartition.Invoke();\n\n var fooBucket = new Aws.S3.BucketV2(\"fooBucket\");\n\n var exampleMultiRegionAccessPoint = new Aws.S3Control.MultiRegionAccessPoint(\"exampleMultiRegionAccessPoint\", new()\n {\n Details = new Aws.S3Control.Inputs.MultiRegionAccessPointDetailsArgs\n {\n Name = \"example\",\n Regions = new[]\n {\n new Aws.S3Control.Inputs.MultiRegionAccessPointDetailsRegionArgs\n {\n Bucket = fooBucket.Id,\n },\n },\n },\n });\n\n var exampleMultiRegionAccessPointPolicy = new Aws.S3Control.MultiRegionAccessPointPolicy(\"exampleMultiRegionAccessPointPolicy\", new()\n {\n Details = new Aws.S3Control.Inputs.MultiRegionAccessPointPolicyDetailsArgs\n {\n Name = exampleMultiRegionAccessPoint.Id.Apply(id =\u003e id.Split(\":\"))[1],\n Policy = Output.Tuple(currentCallerIdentity, currentPartition, currentCallerIdentity, exampleMultiRegionAccessPoint.Alias).Apply(values =\u003e\n {\n var currentCallerIdentity = values.Item1;\n var currentPartition = values.Item2;\n var currentCallerIdentity1 = values.Item3;\n var @alias = values.Item4;\n return JsonSerializer.Serialize(new Dictionary\u003cstring, object?\u003e\n {\n [\"Version\"] = \"2012-10-17\",\n [\"Statement\"] = new[]\n {\n new Dictionary\u003cstring, object?\u003e\n {\n [\"Sid\"] = \"Example\",\n [\"Effect\"] = \"Allow\",\n [\"Principal\"] = new Dictionary\u003cstring, object?\u003e\n {\n [\"AWS\"] = currentCallerIdentity.Apply(getCallerIdentityResult =\u003e getCallerIdentityResult.AccountId),\n },\n [\"Action\"] = new[]\n {\n \"s3:GetObject\",\n \"s3:PutObject\",\n },\n [\"Resource\"] = $\"arn:{currentPartition.Apply(getPartitionResult =\u003e getPartitionResult.Partition)}:s3::{currentCallerIdentity1.AccountId}:accesspoint/{@alias}/object/*\",\n },\n },\n });\n }),\n },\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\n\t\"github.com/pulumi/pulumi-aws/sdk/v6/go/aws\"\n\t\"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/s3\"\n\t\"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/s3control\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\tcurrentCallerIdentity, err := aws.GetCallerIdentity(ctx, nil, nil)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcurrentPartition, err := aws.GetPartition(ctx, nil, nil)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfooBucket, err := s3.NewBucketV2(ctx, \"fooBucket\", nil)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\texampleMultiRegionAccessPoint, err := s3control.NewMultiRegionAccessPoint(ctx, \"exampleMultiRegionAccessPoint\", \u0026s3control.MultiRegionAccessPointArgs{\n\t\t\tDetails: \u0026s3control.MultiRegionAccessPointDetailsArgs{\n\t\t\t\tName: pulumi.String(\"example\"),\n\t\t\t\tRegions: s3control.MultiRegionAccessPointDetailsRegionArray{\n\t\t\t\t\t\u0026s3control.MultiRegionAccessPointDetailsRegionArgs{\n\t\t\t\t\t\tBucket: fooBucket.ID(),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = s3control.NewMultiRegionAccessPointPolicy(ctx, \"exampleMultiRegionAccessPointPolicy\", \u0026s3control.MultiRegionAccessPointPolicyArgs{\n\t\t\tDetails: \u0026s3control.MultiRegionAccessPointPolicyDetailsArgs{\n\t\t\t\tName: \"TODO: call element\",\n\t\t\t\tPolicy: exampleMultiRegionAccessPoint.Alias.ApplyT(func(alias string) (pulumi.String, error) {\n\t\t\t\t\tvar _zero pulumi.String\n\t\t\t\t\ttmpJSON0, err := json.Marshal(map[string]interface{}{\n\t\t\t\t\t\t\"Version\": \"2012-10-17\",\n\t\t\t\t\t\t\"Statement\": []map[string]interface{}{\n\t\t\t\t\t\t\tmap[string]interface{}{\n\t\t\t\t\t\t\t\t\"Sid\": \"Example\",\n\t\t\t\t\t\t\t\t\"Effect\": \"Allow\",\n\t\t\t\t\t\t\t\t\"Principal\": map[string]interface{}{\n\t\t\t\t\t\t\t\t\t\"AWS\": currentCallerIdentity.AccountId,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\"Action\": []string{\n\t\t\t\t\t\t\t\t\t\"s3:GetObject\",\n\t\t\t\t\t\t\t\t\t\"s3:PutObject\",\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\"Resource\": fmt.Sprintf(\"arn:%v:s3::%v:accesspoint/%v/object/*\", currentPartition.Partition, currentCallerIdentity.AccountId, alias),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t})\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn _zero, err\n\t\t\t\t\t}\n\t\t\t\t\tjson0 := string(tmpJSON0)\n\t\t\t\t\treturn pulumi.String(json0), nil\n\t\t\t\t}).(pulumi.StringOutput),\n\t\t\t},\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.aws.AwsFunctions;\nimport com.pulumi.aws.inputs.GetCallerIdentityArgs;\nimport com.pulumi.aws.inputs.GetPartitionArgs;\nimport com.pulumi.aws.s3.BucketV2;\nimport com.pulumi.aws.s3control.MultiRegionAccessPoint;\nimport com.pulumi.aws.s3control.MultiRegionAccessPointArgs;\nimport com.pulumi.aws.s3control.inputs.MultiRegionAccessPointDetailsArgs;\nimport com.pulumi.aws.s3control.MultiRegionAccessPointPolicy;\nimport com.pulumi.aws.s3control.MultiRegionAccessPointPolicyArgs;\nimport com.pulumi.aws.s3control.inputs.MultiRegionAccessPointPolicyDetailsArgs;\nimport static com.pulumi.codegen.internal.Serialization.*;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n final var currentCallerIdentity = AwsFunctions.getCallerIdentity();\n\n final var currentPartition = AwsFunctions.getPartition();\n\n var fooBucket = new BucketV2(\"fooBucket\");\n\n var exampleMultiRegionAccessPoint = new MultiRegionAccessPoint(\"exampleMultiRegionAccessPoint\", MultiRegionAccessPointArgs.builder() \n .details(MultiRegionAccessPointDetailsArgs.builder()\n .name(\"example\")\n .regions(MultiRegionAccessPointDetailsRegionArgs.builder()\n .bucket(fooBucket.id())\n .build())\n .build())\n .build());\n\n var exampleMultiRegionAccessPointPolicy = new MultiRegionAccessPointPolicy(\"exampleMultiRegionAccessPointPolicy\", MultiRegionAccessPointPolicyArgs.builder() \n .details(MultiRegionAccessPointPolicyDetailsArgs.builder()\n .name(exampleMultiRegionAccessPoint.id().applyValue(id -\u003e id.split(\":\"))[1])\n .policy(exampleMultiRegionAccessPoint.alias().applyValue(alias -\u003e serializeJson(\n jsonObject(\n jsonProperty(\"Version\", \"2012-10-17\"),\n jsonProperty(\"Statement\", jsonArray(jsonObject(\n jsonProperty(\"Sid\", \"Example\"),\n jsonProperty(\"Effect\", \"Allow\"),\n jsonProperty(\"Principal\", jsonObject(\n jsonProperty(\"AWS\", currentCallerIdentity.applyValue(getCallerIdentityResult -\u003e getCallerIdentityResult.accountId()))\n )),\n jsonProperty(\"Action\", jsonArray(\n \"s3:GetObject\", \n \"s3:PutObject\"\n )),\n jsonProperty(\"Resource\", String.format(\"arn:%s:s3::%s:accesspoint/%s/object/*\", currentPartition.applyValue(getPartitionResult -\u003e getPartitionResult.partition()),currentCallerIdentity.applyValue(getCallerIdentityResult -\u003e getCallerIdentityResult.accountId()),alias))\n )))\n ))))\n .build())\n .build());\n\n }\n}\n```\n```yaml\nresources:\n fooBucket:\n type: aws:s3:BucketV2\n exampleMultiRegionAccessPoint:\n type: aws:s3control:MultiRegionAccessPoint\n properties:\n details:\n name: example\n regions:\n - bucket: ${fooBucket.id}\n exampleMultiRegionAccessPointPolicy:\n type: aws:s3control:MultiRegionAccessPointPolicy\n properties:\n details:\n name:\n fn::select:\n - 1\n - fn::split:\n - ${exampleMultiRegionAccessPoint.id}\n - ':'\n policy:\n fn::toJSON:\n Version: 2012-10-17\n Statement:\n - Sid: Example\n Effect: Allow\n Principal:\n AWS: ${currentCallerIdentity.accountId}\n Action:\n - s3:GetObject\n - s3:PutObject\n Resource: arn:${currentPartition.partition}:s3::${currentCallerIdentity.accountId}:accesspoint/${exampleMultiRegionAccessPoint.alias}/object/*\nvariables:\n currentCallerIdentity:\n fn::invoke:\n Function: aws:getCallerIdentity\n Arguments: {}\n currentPartition:\n fn::invoke:\n Function: aws:getPartition\n Arguments: {}\n```\n{{% /example %}}\n{{% /examples %}}\n\n## Import\n\nUsing `pulumi import`, import Multi-Region Access Point Policies using the `account_id` and `name` of the Multi-Region Access Point separated by a colon (`:`). For example:\n\n```sh\n $ pulumi import aws:s3control/multiRegionAccessPointPolicy:MultiRegionAccessPointPolicy example 123456789012:example\n```\n ", "properties": { "accountId": { "type": "string", @@ -305454,7 +305454,7 @@ } }, "aws:sns/topicSubscription:TopicSubscription": { - "description": "Provides a resource for subscribing to SNS topics. Requires that an SNS topic exist for the subscription to attach to. This resource allows you to automatically place messages sent to SNS topics in SQS queues, send them as HTTP(S) POST requests to a given endpoint, send SMS messages, or notify devices / applications. The most likely use case for provider users will probably be SQS queues.\n\n\u003e **NOTE:** If the SNS topic and SQS queue are in different AWS regions, the `aws.sns.TopicSubscription` must use an AWS provider that is in the same region as the SNS topic. If the `aws.sns.TopicSubscription` uses a provider with a different region than the SNS topic, this provider will fail to create the subscription.\n\n\u003e **NOTE:** Setup of cross-account subscriptions from SNS topics to SQS queues requires the provider to have access to BOTH accounts.\n\n\u003e **NOTE:** If an SNS topic and SQS queue are in different AWS accounts but the same region, the `aws.sns.TopicSubscription` must use the AWS provider for the account with the SQS queue. If `aws.sns.TopicSubscription` uses a Provider with a different account than the SQS queue, this provider creates the subscription but does not keep state and tries to re-create the subscription at every `apply`.\n\n\u003e **NOTE:** If an SNS topic and SQS queue are in different AWS accounts and different AWS regions, the subscription needs to be initiated from the account with the SQS queue but in the region of the SNS topic.\n\n\u003e **NOTE:** You cannot unsubscribe to a subscription that is pending confirmation. If you use `email`, `email-json`, or `http`/`https` (without auto-confirmation enabled), until the subscription is confirmed (e.g., outside of this provider), AWS does not allow this provider to delete / unsubscribe the subscription. If you `destroy` an unconfirmed subscription, this provider will remove the subscription from its state but the subscription will still exist in AWS. However, if you delete an SNS topic, SNS [deletes all the subscriptions](https://docs.aws.amazon.com/sns/latest/dg/sns-delete-subscription-topic.html) associated with the topic. Also, you can import a subscription after confirmation and then have the capability to delete it.\n\n{{% examples %}}\n## Example Usage\n{{% example %}}\n\nYou can directly supply a topic and ARN by hand in the `topic_arn` property along with the queue ARN:\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as aws from \"@pulumi/aws\";\n\nconst userUpdatesSqsTarget = new aws.sns.TopicSubscription(\"userUpdatesSqsTarget\", {\n endpoint: \"arn:aws:sqs:us-west-2:432981146916:queue-too\",\n protocol: \"sqs\",\n topic: \"arn:aws:sns:us-west-2:432981146916:user-updates-topic\",\n});\n```\n```python\nimport pulumi\nimport pulumi_aws as aws\n\nuser_updates_sqs_target = aws.sns.TopicSubscription(\"userUpdatesSqsTarget\",\n endpoint=\"arn:aws:sqs:us-west-2:432981146916:queue-too\",\n protocol=\"sqs\",\n topic=\"arn:aws:sns:us-west-2:432981146916:user-updates-topic\")\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Aws = Pulumi.Aws;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var userUpdatesSqsTarget = new Aws.Sns.TopicSubscription(\"userUpdatesSqsTarget\", new()\n {\n Endpoint = \"arn:aws:sqs:us-west-2:432981146916:queue-too\",\n Protocol = \"sqs\",\n Topic = \"arn:aws:sns:us-west-2:432981146916:user-updates-topic\",\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/sns\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t_, err := sns.NewTopicSubscription(ctx, \"userUpdatesSqsTarget\", \u0026sns.TopicSubscriptionArgs{\n\t\t\tEndpoint: pulumi.String(\"arn:aws:sqs:us-west-2:432981146916:queue-too\"),\n\t\t\tProtocol: pulumi.String(\"sqs\"),\n\t\t\tTopic: pulumi.Any(\"arn:aws:sns:us-west-2:432981146916:user-updates-topic\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.aws.sns.TopicSubscription;\nimport com.pulumi.aws.sns.TopicSubscriptionArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n var userUpdatesSqsTarget = new TopicSubscription(\"userUpdatesSqsTarget\", TopicSubscriptionArgs.builder() \n .endpoint(\"arn:aws:sqs:us-west-2:432981146916:queue-too\")\n .protocol(\"sqs\")\n .topic(\"arn:aws:sns:us-west-2:432981146916:user-updates-topic\")\n .build());\n\n }\n}\n```\n```yaml\nresources:\n userUpdatesSqsTarget:\n type: aws:sns:TopicSubscription\n properties:\n endpoint: arn:aws:sqs:us-west-2:432981146916:queue-too\n protocol: sqs\n topic: arn:aws:sns:us-west-2:432981146916:user-updates-topic\n```\n\nAlternatively you can use the ARN properties of a managed SNS topic and SQS queue:\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as aws from \"@pulumi/aws\";\n\nconst userUpdates = new aws.sns.Topic(\"userUpdates\", {});\nconst userUpdatesQueue = new aws.sqs.Queue(\"userUpdatesQueue\", {});\nconst userUpdatesSqsTarget = new aws.sns.TopicSubscription(\"userUpdatesSqsTarget\", {\n topic: userUpdates.arn,\n protocol: \"sqs\",\n endpoint: userUpdatesQueue.arn,\n});\n```\n```python\nimport pulumi\nimport pulumi_aws as aws\n\nuser_updates = aws.sns.Topic(\"userUpdates\")\nuser_updates_queue = aws.sqs.Queue(\"userUpdatesQueue\")\nuser_updates_sqs_target = aws.sns.TopicSubscription(\"userUpdatesSqsTarget\",\n topic=user_updates.arn,\n protocol=\"sqs\",\n endpoint=user_updates_queue.arn)\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Aws = Pulumi.Aws;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var userUpdates = new Aws.Sns.Topic(\"userUpdates\");\n\n var userUpdatesQueue = new Aws.Sqs.Queue(\"userUpdatesQueue\");\n\n var userUpdatesSqsTarget = new Aws.Sns.TopicSubscription(\"userUpdatesSqsTarget\", new()\n {\n Topic = userUpdates.Arn,\n Protocol = \"sqs\",\n Endpoint = userUpdatesQueue.Arn,\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/sns\"\n\t\"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/sqs\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\tuserUpdates, err := sns.NewTopic(ctx, \"userUpdates\", nil)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tuserUpdatesQueue, err := sqs.NewQueue(ctx, \"userUpdatesQueue\", nil)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = sns.NewTopicSubscription(ctx, \"userUpdatesSqsTarget\", \u0026sns.TopicSubscriptionArgs{\n\t\t\tTopic: userUpdates.Arn,\n\t\t\tProtocol: pulumi.String(\"sqs\"),\n\t\t\tEndpoint: userUpdatesQueue.Arn,\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.aws.sns.Topic;\nimport com.pulumi.aws.sqs.Queue;\nimport com.pulumi.aws.sns.TopicSubscription;\nimport com.pulumi.aws.sns.TopicSubscriptionArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n var userUpdates = new Topic(\"userUpdates\");\n\n var userUpdatesQueue = new Queue(\"userUpdatesQueue\");\n\n var userUpdatesSqsTarget = new TopicSubscription(\"userUpdatesSqsTarget\", TopicSubscriptionArgs.builder() \n .topic(userUpdates.arn())\n .protocol(\"sqs\")\n .endpoint(userUpdatesQueue.arn())\n .build());\n\n }\n}\n```\n```yaml\nresources:\n userUpdates:\n type: aws:sns:Topic\n userUpdatesQueue:\n type: aws:sqs:Queue\n userUpdatesSqsTarget:\n type: aws:sns:TopicSubscription\n properties:\n topic: ${userUpdates.arn}\n protocol: sqs\n endpoint: ${userUpdatesQueue.arn}\n```\n\nYou can subscribe SNS topics to SQS queues in different Amazon accounts and regions:\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as aws from \"@pulumi/aws\";\n\nconst config = new pulumi.Config();\nconst sns = config.getObject\u003c{account-id?: string, display_name?: string, name?: string, region?: string, role-name?: string}\u003e(\"sns\") || {\n \"account-id\": \"111111111111\",\n \"role-name\": \"service/service\",\n name: \"example-sns-topic\",\n display_name: \"example\",\n region: \"us-west-1\",\n};\nconst sqs = config.getObject\u003c{account-id?: string, name?: string, region?: string, role-name?: string}\u003e(\"sqs\") || {\n \"account-id\": \"222222222222\",\n \"role-name\": \"service/service\",\n name: \"example-sqs-queue\",\n region: \"us-east-1\",\n};\nconst sns-topic-policy = aws.iam.getPolicyDocument({\n policyId: \"__default_policy_ID\",\n statements: [\n {\n actions: [\n \"SNS:Subscribe\",\n \"SNS:SetTopicAttributes\",\n \"SNS:RemovePermission\",\n \"SNS:Publish\",\n \"SNS:ListSubscriptionsByTopic\",\n \"SNS:GetTopicAttributes\",\n \"SNS:DeleteTopic\",\n \"SNS:AddPermission\",\n ],\n conditions: [{\n test: \"StringEquals\",\n variable: \"AWS:SourceOwner\",\n values: [sns[\"account-id\"]],\n }],\n effect: \"Allow\",\n principals: [{\n type: \"AWS\",\n identifiers: [\"*\"],\n }],\n resources: [`arn:aws:sns:${sns.region}:${sns[\"account-id\"]}:${sns.name}`],\n sid: \"__default_statement_ID\",\n },\n {\n actions: [\n \"SNS:Subscribe\",\n \"SNS:Receive\",\n ],\n conditions: [{\n test: \"StringLike\",\n variable: \"SNS:Endpoint\",\n values: [`arn:aws:sqs:${sqs.region}:${sqs[\"account-id\"]}:${sqs.name}`],\n }],\n effect: \"Allow\",\n principals: [{\n type: \"AWS\",\n identifiers: [\"*\"],\n }],\n resources: [`arn:aws:sns:${sns.region}:${sns[\"account-id\"]}:${sns.name}`],\n sid: \"__console_sub_0\",\n },\n ],\n});\nconst sqs-queue-policy = aws.iam.getPolicyDocument({\n policyId: `arn:aws:sqs:${sqs.region}:${sqs[\"account-id\"]}:${sqs.name}/SQSDefaultPolicy`,\n statements: [{\n sid: \"example-sns-topic\",\n effect: \"Allow\",\n principals: [{\n type: \"AWS\",\n identifiers: [\"*\"],\n }],\n actions: [\"SQS:SendMessage\"],\n resources: [`arn:aws:sqs:${sqs.region}:${sqs[\"account-id\"]}:${sqs.name}`],\n conditions: [{\n test: \"ArnEquals\",\n variable: \"aws:SourceArn\",\n values: [`arn:aws:sns:${sns.region}:${sns[\"account-id\"]}:${sns.name}`],\n }],\n }],\n});\n// provider to manage SNS topics\nconst awsSns = new aws.Provider(\"awsSns\", {\n region: sns.region,\n assumeRole: {\n roleArn: `arn:aws:iam::${sns[\"account-id\"]}:role/${sns[\"role-name\"]}`,\n sessionName: `sns-${sns.region}`,\n },\n});\n// provider to manage SQS queues\nconst awsSqs = new aws.Provider(\"awsSqs\", {\n region: sqs.region,\n assumeRole: {\n roleArn: `arn:aws:iam::${sqs[\"account-id\"]}:role/${sqs[\"role-name\"]}`,\n sessionName: `sqs-${sqs.region}`,\n },\n});\n// provider to subscribe SQS to SNS (using the SQS account but the SNS region)\nconst sns2sqs = new aws.Provider(\"sns2sqs\", {\n region: sns.region,\n assumeRole: {\n roleArn: `arn:aws:iam::${sqs[\"account-id\"]}:role/${sqs[\"role-name\"]}`,\n sessionName: `sns2sqs-${sns.region}`,\n },\n});\nconst sns_topicTopic = new aws.sns.Topic(\"sns-topicTopic\", {\n displayName: sns.display_name,\n policy: sns_topic_policy.then(sns_topic_policy =\u003e sns_topic_policy.json),\n}, {\n provider: aws.sns,\n});\nconst sqs_queue = new aws.sqs.Queue(\"sqs-queue\", {policy: sqs_queue_policy.then(sqs_queue_policy =\u003e sqs_queue_policy.json)}, {\n provider: aws.sqs,\n});\nconst sns_topicTopicSubscription = new aws.sns.TopicSubscription(\"sns-topicTopicSubscription\", {\n topic: sns_topicTopic.arn,\n protocol: \"sqs\",\n endpoint: sqs_queue.arn,\n}, {\n provider: aws.sns2sqs,\n});\n```\n```python\nimport pulumi\nimport pulumi_aws as aws\n\nconfig = pulumi.Config()\nsns = config.get_object(\"sns\")\nif sns is None:\n sns = {\n \"account-id\": \"111111111111\",\n \"role-name\": \"service/service\",\n \"name\": \"example-sns-topic\",\n \"display_name\": \"example\",\n \"region\": \"us-west-1\",\n }\nsqs = config.get_object(\"sqs\")\nif sqs is None:\n sqs = {\n \"account-id\": \"222222222222\",\n \"role-name\": \"service/service\",\n \"name\": \"example-sqs-queue\",\n \"region\": \"us-east-1\",\n }\nsns_topic_policy = aws.iam.get_policy_document(policy_id=\"__default_policy_ID\",\n statements=[\n aws.iam.GetPolicyDocumentStatementArgs(\n actions=[\n \"SNS:Subscribe\",\n \"SNS:SetTopicAttributes\",\n \"SNS:RemovePermission\",\n \"SNS:Publish\",\n \"SNS:ListSubscriptionsByTopic\",\n \"SNS:GetTopicAttributes\",\n \"SNS:DeleteTopic\",\n \"SNS:AddPermission\",\n ],\n conditions=[aws.iam.GetPolicyDocumentStatementConditionArgs(\n test=\"StringEquals\",\n variable=\"AWS:SourceOwner\",\n values=[sns[\"account-id\"]],\n )],\n effect=\"Allow\",\n principals=[aws.iam.GetPolicyDocumentStatementPrincipalArgs(\n type=\"AWS\",\n identifiers=[\"*\"],\n )],\n resources=[f\"arn:aws:sns:{sns['region']}:{sns['account-id']}:{sns['name']}\"],\n sid=\"__default_statement_ID\",\n ),\n aws.iam.GetPolicyDocumentStatementArgs(\n actions=[\n \"SNS:Subscribe\",\n \"SNS:Receive\",\n ],\n conditions=[aws.iam.GetPolicyDocumentStatementConditionArgs(\n test=\"StringLike\",\n variable=\"SNS:Endpoint\",\n values=[f\"arn:aws:sqs:{sqs['region']}:{sqs['account-id']}:{sqs['name']}\"],\n )],\n effect=\"Allow\",\n principals=[aws.iam.GetPolicyDocumentStatementPrincipalArgs(\n type=\"AWS\",\n identifiers=[\"*\"],\n )],\n resources=[f\"arn:aws:sns:{sns['region']}:{sns['account-id']}:{sns['name']}\"],\n sid=\"__console_sub_0\",\n ),\n ])\nsqs_queue_policy = aws.iam.get_policy_document(policy_id=f\"arn:aws:sqs:{sqs['region']}:{sqs['account-id']}:{sqs['name']}/SQSDefaultPolicy\",\n statements=[aws.iam.GetPolicyDocumentStatementArgs(\n sid=\"example-sns-topic\",\n effect=\"Allow\",\n principals=[aws.iam.GetPolicyDocumentStatementPrincipalArgs(\n type=\"AWS\",\n identifiers=[\"*\"],\n )],\n actions=[\"SQS:SendMessage\"],\n resources=[f\"arn:aws:sqs:{sqs['region']}:{sqs['account-id']}:{sqs['name']}\"],\n conditions=[aws.iam.GetPolicyDocumentStatementConditionArgs(\n test=\"ArnEquals\",\n variable=\"aws:SourceArn\",\n values=[f\"arn:aws:sns:{sns['region']}:{sns['account-id']}:{sns['name']}\"],\n )],\n )])\n# provider to manage SNS topics\naws_sns = aws.Provider(\"awsSns\",\n region=sns[\"region\"],\n assume_role=aws.ProviderAssumeRoleArgs(\n role_arn=f\"arn:aws:iam::{sns['account-id']}:role/{sns['role-name']}\",\n session_name=f\"sns-{sns['region']}\",\n ))\n# provider to manage SQS queues\naws_sqs = aws.Provider(\"awsSqs\",\n region=sqs[\"region\"],\n assume_role=aws.ProviderAssumeRoleArgs(\n role_arn=f\"arn:aws:iam::{sqs['account-id']}:role/{sqs['role-name']}\",\n session_name=f\"sqs-{sqs['region']}\",\n ))\n# provider to subscribe SQS to SNS (using the SQS account but the SNS region)\nsns2sqs = aws.Provider(\"sns2sqs\",\n region=sns[\"region\"],\n assume_role=aws.ProviderAssumeRoleArgs(\n role_arn=f\"arn:aws:iam::{sqs['account-id']}:role/{sqs['role-name']}\",\n session_name=f\"sns2sqs-{sns['region']}\",\n ))\nsns_topic_topic = aws.sns.Topic(\"sns-topicTopic\",\n display_name=sns[\"display_name\"],\n policy=sns_topic_policy.json,\n opts=pulumi.ResourceOptions(provider=aws[\"sns\"]))\nsqs_queue = aws.sqs.Queue(\"sqs-queue\", policy=sqs_queue_policy.json,\nopts=pulumi.ResourceOptions(provider=aws[\"sqs\"]))\nsns_topic_topic_subscription = aws.sns.TopicSubscription(\"sns-topicTopicSubscription\",\n topic=sns_topic_topic.arn,\n protocol=\"sqs\",\n endpoint=sqs_queue.arn,\n opts=pulumi.ResourceOptions(provider=aws[\"sns2sqs\"]))\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Aws = Pulumi.Aws;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var config = new Config();\n var sns = config.GetObject\u003cSns\u003e(\"sns\") ?? \n {\n { \"account-id\", \"111111111111\" },\n { \"role-name\", \"service/service\" },\n { \"name\", \"example-sns-topic\" },\n { \"display_name\", \"example\" },\n { \"region\", \"us-west-1\" },\n };\n var sqs = config.GetObject\u003cSqs\u003e(\"sqs\") ?? \n {\n { \"account-id\", \"222222222222\" },\n { \"role-name\", \"service/service\" },\n { \"name\", \"example-sqs-queue\" },\n { \"region\", \"us-east-1\" },\n };\n var sns_topic_policy = Aws.Iam.GetPolicyDocument.Invoke(new()\n {\n PolicyId = \"__default_policy_ID\",\n Statements = new[]\n {\n new Aws.Iam.Inputs.GetPolicyDocumentStatementInputArgs\n {\n Actions = new[]\n {\n \"SNS:Subscribe\",\n \"SNS:SetTopicAttributes\",\n \"SNS:RemovePermission\",\n \"SNS:Publish\",\n \"SNS:ListSubscriptionsByTopic\",\n \"SNS:GetTopicAttributes\",\n \"SNS:DeleteTopic\",\n \"SNS:AddPermission\",\n },\n Conditions = new[]\n {\n new Aws.Iam.Inputs.GetPolicyDocumentStatementConditionInputArgs\n {\n Test = \"StringEquals\",\n Variable = \"AWS:SourceOwner\",\n Values = new[]\n {\n sns.Account_id,\n },\n },\n },\n Effect = \"Allow\",\n Principals = new[]\n {\n new Aws.Iam.Inputs.GetPolicyDocumentStatementPrincipalInputArgs\n {\n Type = \"AWS\",\n Identifiers = new[]\n {\n \"*\",\n },\n },\n },\n Resources = new[]\n {\n $\"arn:aws:sns:{sns.Region}:{sns.Account_id}:{sns.Name}\",\n },\n Sid = \"__default_statement_ID\",\n },\n new Aws.Iam.Inputs.GetPolicyDocumentStatementInputArgs\n {\n Actions = new[]\n {\n \"SNS:Subscribe\",\n \"SNS:Receive\",\n },\n Conditions = new[]\n {\n new Aws.Iam.Inputs.GetPolicyDocumentStatementConditionInputArgs\n {\n Test = \"StringLike\",\n Variable = \"SNS:Endpoint\",\n Values = new[]\n {\n $\"arn:aws:sqs:{sqs.Region}:{sqs.Account_id}:{sqs.Name}\",\n },\n },\n },\n Effect = \"Allow\",\n Principals = new[]\n {\n new Aws.Iam.Inputs.GetPolicyDocumentStatementPrincipalInputArgs\n {\n Type = \"AWS\",\n Identifiers = new[]\n {\n \"*\",\n },\n },\n },\n Resources = new[]\n {\n $\"arn:aws:sns:{sns.Region}:{sns.Account_id}:{sns.Name}\",\n },\n Sid = \"__console_sub_0\",\n },\n },\n });\n\n var sqs_queue_policy = Aws.Iam.GetPolicyDocument.Invoke(new()\n {\n PolicyId = $\"arn:aws:sqs:{sqs.Region}:{sqs.Account_id}:{sqs.Name}/SQSDefaultPolicy\",\n Statements = new[]\n {\n new Aws.Iam.Inputs.GetPolicyDocumentStatementInputArgs\n {\n Sid = \"example-sns-topic\",\n Effect = \"Allow\",\n Principals = new[]\n {\n new Aws.Iam.Inputs.GetPolicyDocumentStatementPrincipalInputArgs\n {\n Type = \"AWS\",\n Identifiers = new[]\n {\n \"*\",\n },\n },\n },\n Actions = new[]\n {\n \"SQS:SendMessage\",\n },\n Resources = new[]\n {\n $\"arn:aws:sqs:{sqs.Region}:{sqs.Account_id}:{sqs.Name}\",\n },\n Conditions = new[]\n {\n new Aws.Iam.Inputs.GetPolicyDocumentStatementConditionInputArgs\n {\n Test = \"ArnEquals\",\n Variable = \"aws:SourceArn\",\n Values = new[]\n {\n $\"arn:aws:sns:{sns.Region}:{sns.Account_id}:{sns.Name}\",\n },\n },\n },\n },\n },\n });\n\n // provider to manage SNS topics\n var awsSns = new Aws.Provider(\"awsSns\", new()\n {\n Region = sns.Region,\n AssumeRole = new Aws.Inputs.ProviderAssumeRoleArgs\n {\n RoleArn = $\"arn:aws:iam::{sns.Account_id}:role/{sns.Role_name}\",\n SessionName = $\"sns-{sns.Region}\",\n },\n });\n\n // provider to manage SQS queues\n var awsSqs = new Aws.Provider(\"awsSqs\", new()\n {\n Region = sqs.Region,\n AssumeRole = new Aws.Inputs.ProviderAssumeRoleArgs\n {\n RoleArn = $\"arn:aws:iam::{sqs.Account_id}:role/{sqs.Role_name}\",\n SessionName = $\"sqs-{sqs.Region}\",\n },\n });\n\n // provider to subscribe SQS to SNS (using the SQS account but the SNS region)\n var sns2sqs = new Aws.Provider(\"sns2sqs\", new()\n {\n Region = sns.Region,\n AssumeRole = new Aws.Inputs.ProviderAssumeRoleArgs\n {\n RoleArn = $\"arn:aws:iam::{sqs.Account_id}:role/{sqs.Role_name}\",\n SessionName = $\"sns2sqs-{sns.Region}\",\n },\n });\n\n var sns_topicTopic = new Aws.Sns.Topic(\"sns-topicTopic\", new()\n {\n DisplayName = sns.Display_name,\n Policy = sns_topic_policy.Apply(sns_topic_policy =\u003e sns_topic_policy.Apply(getPolicyDocumentResult =\u003e getPolicyDocumentResult.Json)),\n }, new CustomResourceOptions\n {\n Provider = aws.Sns,\n });\n\n var sqs_queue = new Aws.Sqs.Queue(\"sqs-queue\", new()\n {\n Policy = sqs_queue_policy.Apply(sqs_queue_policy =\u003e sqs_queue_policy.Apply(getPolicyDocumentResult =\u003e getPolicyDocumentResult.Json)),\n }, new CustomResourceOptions\n {\n Provider = aws.Sqs,\n });\n\n var sns_topicTopicSubscription = new Aws.Sns.TopicSubscription(\"sns-topicTopicSubscription\", new()\n {\n Topic = sns_topicTopic.Arn,\n Protocol = \"sqs\",\n Endpoint = sqs_queue.Arn,\n }, new CustomResourceOptions\n {\n Provider = aws.Sns2sqs,\n });\n\n});\n\npublic class Sns\n{\n public string account-id { get; set; }\n public string display_name { get; set; }\n public string name { get; set; }\n public string region { get; set; }\n public string role-name { get; set; }\n}\n\npublic class Sqs\n{\n public string account-id { get; set; }\n public string name { get; set; }\n public string region { get; set; }\n public string role-name { get; set; }\n}\n```\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/pulumi/pulumi-aws/sdk/v6/go/aws\"\n\t\"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iam\"\n\t\"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/sns\"\n\t\"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/sqs\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config\"\n)\nfunc main() {\npulumi.Run(func(ctx *pulumi.Context) error {\ncfg := config.New(ctx, \"\")\nsns := map[string]interface{}{\n\"account-id\": \"111111111111\",\n\"role-name\": \"service/service\",\n\"name\": \"example-sns-topic\",\n\"display_name\": \"example\",\n\"region\": \"us-west-1\",\n};\nif param := cfg.GetBool(\"sns\"); param != nil {\nsns = param\n}\nsqs := map[string]interface{}{\n\"account-id\": \"222222222222\",\n\"role-name\": \"service/service\",\n\"name\": \"example-sqs-queue\",\n\"region\": \"us-east-1\",\n};\nif param := cfg.GetBool(\"sqs\"); param != nil {\nsqs = param\n}\nsns_topic_policy, err := iam.GetPolicyDocument(ctx, \u0026iam.GetPolicyDocumentArgs{\nPolicyId: pulumi.StringRef(\"__default_policy_ID\"),\nStatements: []iam.GetPolicyDocumentStatement{\n{\nActions: []string{\n\"SNS:Subscribe\",\n\"SNS:SetTopicAttributes\",\n\"SNS:RemovePermission\",\n\"SNS:Publish\",\n\"SNS:ListSubscriptionsByTopic\",\n\"SNS:GetTopicAttributes\",\n\"SNS:DeleteTopic\",\n\"SNS:AddPermission\",\n},\nConditions: []iam.GetPolicyDocumentStatementCondition{\n{\nTest: \"StringEquals\",\nVariable: \"AWS:SourceOwner\",\nValues: interface{}{\nsns.AccountId,\n},\n},\n},\nEffect: pulumi.StringRef(\"Allow\"),\nPrincipals: []iam.GetPolicyDocumentStatementPrincipal{\n{\nType: \"AWS\",\nIdentifiers: []string{\n\"*\",\n},\n},\n},\nResources: []string{\nfmt.Sprintf(\"arn:aws:sns:%v:%v:%v\", sns.Region, sns.AccountId, sns.Name),\n},\nSid: pulumi.StringRef(\"__default_statement_ID\"),\n},\n{\nActions: []string{\n\"SNS:Subscribe\",\n\"SNS:Receive\",\n},\nConditions: []iam.GetPolicyDocumentStatementCondition{\n{\nTest: \"StringLike\",\nVariable: \"SNS:Endpoint\",\nValues: []string{\nfmt.Sprintf(\"arn:aws:sqs:%v:%v:%v\", sqs.Region, sqs.AccountId, sqs.Name),\n},\n},\n},\nEffect: pulumi.StringRef(\"Allow\"),\nPrincipals: []iam.GetPolicyDocumentStatementPrincipal{\n{\nType: \"AWS\",\nIdentifiers: []string{\n\"*\",\n},\n},\n},\nResources: []string{\nfmt.Sprintf(\"arn:aws:sns:%v:%v:%v\", sns.Region, sns.AccountId, sns.Name),\n},\nSid: pulumi.StringRef(\"__console_sub_0\"),\n},\n},\n}, nil);\nif err != nil {\nreturn err\n}\nsqs_queue_policy, err := iam.GetPolicyDocument(ctx, \u0026iam.GetPolicyDocumentArgs{\nPolicyId: pulumi.StringRef(fmt.Sprintf(\"arn:aws:sqs:%v:%v:%v/SQSDefaultPolicy\", sqs.Region, sqs.AccountId, sqs.Name)),\nStatements: []iam.GetPolicyDocumentStatement{\n{\nSid: pulumi.StringRef(\"example-sns-topic\"),\nEffect: pulumi.StringRef(\"Allow\"),\nPrincipals: []iam.GetPolicyDocumentStatementPrincipal{\n{\nType: \"AWS\",\nIdentifiers: []string{\n\"*\",\n},\n},\n},\nActions: []string{\n\"SQS:SendMessage\",\n},\nResources: []string{\nfmt.Sprintf(\"arn:aws:sqs:%v:%v:%v\", sqs.Region, sqs.AccountId, sqs.Name),\n},\nConditions: []iam.GetPolicyDocumentStatementCondition{\n{\nTest: \"ArnEquals\",\nVariable: \"aws:SourceArn\",\nValues: []string{\nfmt.Sprintf(\"arn:aws:sns:%v:%v:%v\", sns.Region, sns.AccountId, sns.Name),\n},\n},\n},\n},\n},\n}, nil);\nif err != nil {\nreturn err\n}\n_, err = aws.NewProvider(ctx, \"awsSns\", \u0026aws.ProviderArgs{\nRegion: *pulumi.String(sns.Region),\nAssumeRole: \u0026aws.ProviderAssumeRoleArgs{\nRoleArn: pulumi.String(fmt.Sprintf(\"arn:aws:iam::%v:role/%v\", sns.AccountId, sns.RoleName)),\nSessionName: pulumi.String(fmt.Sprintf(\"sns-%v\", sns.Region)),\n},\n})\nif err != nil {\nreturn err\n}\n_, err = aws.NewProvider(ctx, \"awsSqs\", \u0026aws.ProviderArgs{\nRegion: *pulumi.String(sqs.Region),\nAssumeRole: \u0026aws.ProviderAssumeRoleArgs{\nRoleArn: pulumi.String(fmt.Sprintf(\"arn:aws:iam::%v:role/%v\", sqs.AccountId, sqs.RoleName)),\nSessionName: pulumi.String(fmt.Sprintf(\"sqs-%v\", sqs.Region)),\n},\n})\nif err != nil {\nreturn err\n}\n_, err = aws.NewProvider(ctx, \"sns2sqs\", \u0026aws.ProviderArgs{\nRegion: *pulumi.String(sns.Region),\nAssumeRole: \u0026aws.ProviderAssumeRoleArgs{\nRoleArn: pulumi.String(fmt.Sprintf(\"arn:aws:iam::%v:role/%v\", sqs.AccountId, sqs.RoleName)),\nSessionName: pulumi.String(fmt.Sprintf(\"sns2sqs-%v\", sns.Region)),\n},\n})\nif err != nil {\nreturn err\n}\n_, err = sns.NewTopic(ctx, \"sns-topicTopic\", \u0026sns.TopicArgs{\nDisplayName: *pulumi.String(sns.Display_name),\nPolicy: *pulumi.String(sns_topic_policy.Json),\n}, pulumi.Provider(aws.Sns))\nif err != nil {\nreturn err\n}\n_, err = sqs.NewQueue(ctx, \"sqs-queue\", \u0026sqs.QueueArgs{\nPolicy: *pulumi.String(sqs_queue_policy.Json),\n}, pulumi.Provider(aws.Sqs))\nif err != nil {\nreturn err\n}\n_, err = sns.NewTopicSubscription(ctx, \"sns-topicTopicSubscription\", \u0026sns.TopicSubscriptionArgs{\nTopic: sns_topicTopic.Arn,\nProtocol: pulumi.String(\"sqs\"),\nEndpoint: sqs_queue.Arn,\n}, pulumi.Provider(aws.Sns2sqs))\nif err != nil {\nreturn err\n}\nreturn nil\n})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.aws.iam.IamFunctions;\nimport com.pulumi.aws.iam.inputs.GetPolicyDocumentArgs;\nimport com.pulumi.aws.Provider;\nimport com.pulumi.aws.ProviderArgs;\nimport com.pulumi.aws.inputs.ProviderAssumeRoleArgs;\nimport com.pulumi.aws.sns.Topic;\nimport com.pulumi.aws.sns.TopicArgs;\nimport com.pulumi.aws.sqs.Queue;\nimport com.pulumi.aws.sqs.QueueArgs;\nimport com.pulumi.aws.sns.TopicSubscription;\nimport com.pulumi.aws.sns.TopicSubscriptionArgs;\nimport com.pulumi.resources.CustomResourceOptions;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n final var config = ctx.config();\n final var sns = config.get(\"sns\").orElse(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference));\n final var sqs = config.get(\"sqs\").orElse(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference));\n final var sns-topic-policy = IamFunctions.getPolicyDocument(GetPolicyDocumentArgs.builder()\n .policyId(\"__default_policy_ID\")\n .statements( \n GetPolicyDocumentStatementArgs.builder()\n .actions( \n \"SNS:Subscribe\",\n \"SNS:SetTopicAttributes\",\n \"SNS:RemovePermission\",\n \"SNS:Publish\",\n \"SNS:ListSubscriptionsByTopic\",\n \"SNS:GetTopicAttributes\",\n \"SNS:DeleteTopic\",\n \"SNS:AddPermission\")\n .conditions(GetPolicyDocumentStatementConditionArgs.builder()\n .test(\"StringEquals\")\n .variable(\"AWS:SourceOwner\")\n .values(sns.account-id())\n .build())\n .effect(\"Allow\")\n .principals(GetPolicyDocumentStatementPrincipalArgs.builder()\n .type(\"AWS\")\n .identifiers(\"*\")\n .build())\n .resources(String.format(\"arn:aws:sns:%s:%s:%s\", sns.region(),sns.account-id(),sns.name()))\n .sid(\"__default_statement_ID\")\n .build(),\n GetPolicyDocumentStatementArgs.builder()\n .actions( \n \"SNS:Subscribe\",\n \"SNS:Receive\")\n .conditions(GetPolicyDocumentStatementConditionArgs.builder()\n .test(\"StringLike\")\n .variable(\"SNS:Endpoint\")\n .values(String.format(\"arn:aws:sqs:%s:%s:%s\", sqs.region(),sqs.account-id(),sqs.name()))\n .build())\n .effect(\"Allow\")\n .principals(GetPolicyDocumentStatementPrincipalArgs.builder()\n .type(\"AWS\")\n .identifiers(\"*\")\n .build())\n .resources(String.format(\"arn:aws:sns:%s:%s:%s\", sns.region(),sns.account-id(),sns.name()))\n .sid(\"__console_sub_0\")\n .build())\n .build());\n\n final var sqs-queue-policy = IamFunctions.getPolicyDocument(GetPolicyDocumentArgs.builder()\n .policyId(String.format(\"arn:aws:sqs:%s:%s:%s/SQSDefaultPolicy\", sqs.region(),sqs.account-id(),sqs.name()))\n .statements(GetPolicyDocumentStatementArgs.builder()\n .sid(\"example-sns-topic\")\n .effect(\"Allow\")\n .principals(GetPolicyDocumentStatementPrincipalArgs.builder()\n .type(\"AWS\")\n .identifiers(\"*\")\n .build())\n .actions(\"SQS:SendMessage\")\n .resources(String.format(\"arn:aws:sqs:%s:%s:%s\", sqs.region(),sqs.account-id(),sqs.name()))\n .conditions(GetPolicyDocumentStatementConditionArgs.builder()\n .test(\"ArnEquals\")\n .variable(\"aws:SourceArn\")\n .values(String.format(\"arn:aws:sns:%s:%s:%s\", sns.region(),sns.account-id(),sns.name()))\n .build())\n .build())\n .build());\n\n var awsSns = new Provider(\"awsSns\", ProviderArgs.builder() \n .region(sns.region())\n .assumeRole(ProviderAssumeRoleArgs.builder()\n .roleArn(String.format(\"arn:aws:iam::%s:role/%s\", sns.account-id(),sns.role-name()))\n .sessionName(String.format(\"sns-%s\", sns.region()))\n .build())\n .build());\n\n var awsSqs = new Provider(\"awsSqs\", ProviderArgs.builder() \n .region(sqs.region())\n .assumeRole(ProviderAssumeRoleArgs.builder()\n .roleArn(String.format(\"arn:aws:iam::%s:role/%s\", sqs.account-id(),sqs.role-name()))\n .sessionName(String.format(\"sqs-%s\", sqs.region()))\n .build())\n .build());\n\n var sns2sqs = new Provider(\"sns2sqs\", ProviderArgs.builder() \n .region(sns.region())\n .assumeRole(ProviderAssumeRoleArgs.builder()\n .roleArn(String.format(\"arn:aws:iam::%s:role/%s\", sqs.account-id(),sqs.role-name()))\n .sessionName(String.format(\"sns2sqs-%s\", sns.region()))\n .build())\n .build());\n\n var sns_topicTopic = new Topic(\"sns-topicTopic\", TopicArgs.builder() \n .displayName(sns.display_name())\n .policy(sns_topic_policy.json())\n .build(), CustomResourceOptions.builder()\n .provider(aws.sns())\n .build());\n\n var sqs_queue = new Queue(\"sqs-queue\", QueueArgs.builder() \n .policy(sqs_queue_policy.json())\n .build(), CustomResourceOptions.builder()\n .provider(aws.sqs())\n .build());\n\n var sns_topicTopicSubscription = new TopicSubscription(\"sns-topicTopicSubscription\", TopicSubscriptionArgs.builder() \n .topic(sns_topicTopic.arn())\n .protocol(\"sqs\")\n .endpoint(sqs_queue.arn())\n .build(), CustomResourceOptions.builder()\n .provider(aws.sns2sqs())\n .build());\n\n }\n}\n```\n```yaml\nconfiguration:\n sns:\n type: object({account-id = union(none, string), display_name = union(none, string), name = union(none, string), region = union(none, string), role-name = union(none, string)})\n default:\n account-id: '111111111111'\n role-name: service/service\n name: example-sns-topic\n display_name: example\n region: us-west-1\n sqs:\n type: object({account-id = union(none, string), name = union(none, string), region = union(none, string), role-name = union(none, string)})\n default:\n account-id: '222222222222'\n role-name: service/service\n name: example-sqs-queue\n region: us-east-1\nresources:\n # provider to manage SNS topics\n awsSns:\n type: pulumi:providers:aws\n properties:\n region: ${sns.region}\n assumeRole:\n roleArn: arn:aws:iam::${sns\"account-id\"[%!s(MISSING)]}:role/${sns\"role-name\"[%!s(MISSING)]}\n sessionName: sns-${sns.region}\n # provider to manage SQS queues\n awsSqs:\n type: pulumi:providers:aws\n properties:\n region: ${sqs.region}\n assumeRole:\n roleArn: arn:aws:iam::${sqs\"account-id\"[%!s(MISSING)]}:role/${sqs\"role-name\"[%!s(MISSING)]}\n sessionName: sqs-${sqs.region}\n # provider to subscribe SQS to SNS (using the SQS account but the SNS region)\n sns2sqs:\n type: pulumi:providers:aws\n properties:\n region: ${sns.region}\n assumeRole:\n roleArn: arn:aws:iam::${sqs\"account-id\"[%!s(MISSING)]}:role/${sqs\"role-name\"[%!s(MISSING)]}\n sessionName: sns2sqs-${sns.region}\n sns-topicTopic:\n type: aws:sns:Topic\n properties:\n displayName: ${sns.display_name}\n policy: ${[\"sns-topic-policy\"].json}\n options:\n provider: ${aws.sns}\n sqs-queue:\n type: aws:sqs:Queue\n properties:\n policy: ${[\"sqs-queue-policy\"].json}\n options:\n provider: ${aws.sqs}\n sns-topicTopicSubscription:\n type: aws:sns:TopicSubscription\n properties:\n topic: ${[\"sns-topicTopic\"].arn}\n protocol: sqs\n endpoint: ${[\"sqs-queue\"].arn}\n options:\n provider: ${aws.sns2sqs}\nvariables:\n sns-topic-policy:\n fn::invoke:\n Function: aws:iam:getPolicyDocument\n Arguments:\n policyId: __default_policy_ID\n statements:\n - actions:\n - SNS:Subscribe\n - SNS:SetTopicAttributes\n - SNS:RemovePermission\n - SNS:Publish\n - SNS:ListSubscriptionsByTopic\n - SNS:GetTopicAttributes\n - SNS:DeleteTopic\n - SNS:AddPermission\n conditions:\n - test: StringEquals\n variable: AWS:SourceOwner\n values:\n - ${sns\"account-id\"[%!s(MISSING)]}\n effect: Allow\n principals:\n - type: AWS\n identifiers:\n - '*'\n resources:\n - arn:aws:sns:${sns.region}:${sns\"account-id\"[%!s(MISSING)]}:${sns.name}\n sid: __default_statement_ID\n - actions:\n - SNS:Subscribe\n - SNS:Receive\n conditions:\n - test: StringLike\n variable: SNS:Endpoint\n values:\n - arn:aws:sqs:${sqs.region}:${sqs\"account-id\"[%!s(MISSING)]}:${sqs.name}\n effect: Allow\n principals:\n - type: AWS\n identifiers:\n - '*'\n resources:\n - arn:aws:sns:${sns.region}:${sns\"account-id\"[%!s(MISSING)]}:${sns.name}\n sid: __console_sub_0\n sqs-queue-policy:\n fn::invoke:\n Function: aws:iam:getPolicyDocument\n Arguments:\n policyId: arn:aws:sqs:${sqs.region}:${sqs\"account-id\"[%!s(MISSING)]}:${sqs.name}/SQSDefaultPolicy\n statements:\n - sid: example-sns-topic\n effect: Allow\n principals:\n - type: AWS\n identifiers:\n - '*'\n actions:\n - SQS:SendMessage\n resources:\n - arn:aws:sqs:${sqs.region}:${sqs\"account-id\"[%!s(MISSING)]}:${sqs.name}\n conditions:\n - test: ArnEquals\n variable: aws:SourceArn\n values:\n - arn:aws:sns:${sns.region}:${sns\"account-id\"[%!s(MISSING)]}:${sns.name}\n```\n{{% /example %}}\n{{% /examples %}}\n\n## Import\n\nUsing `pulumi import`, import SNS Topic Subscriptions using the subscription `arn`. For example:\n\n```sh\n $ pulumi import aws:sns/topicSubscription:TopicSubscription user_updates_sqs_target arn:aws:sns:us-west-2:0123456789012:my-topic:8a21d249-4329-4871-acc6-7be709c6ea7f\n```\n ", + "description": "Provides a resource for subscribing to SNS topics. Requires that an SNS topic exist for the subscription to attach to. This resource allows you to automatically place messages sent to SNS topics in SQS queues, send them as HTTP(S) POST requests to a given endpoint, send SMS messages, or notify devices / applications. The most likely use case for provider users will probably be SQS queues.\n\n\u003e **NOTE:** If the SNS topic and SQS queue are in different AWS regions, the `aws.sns.TopicSubscription` must use an AWS provider that is in the same region as the SNS topic. If the `aws.sns.TopicSubscription` uses a provider with a different region than the SNS topic, this provider will fail to create the subscription.\n\n\u003e **NOTE:** Setup of cross-account subscriptions from SNS topics to SQS queues requires the provider to have access to BOTH accounts.\n\n\u003e **NOTE:** If an SNS topic and SQS queue are in different AWS accounts but the same region, the `aws.sns.TopicSubscription` must use the AWS provider for the account with the SQS queue. If `aws.sns.TopicSubscription` uses a Provider with a different account than the SQS queue, this provider creates the subscription but does not keep state and tries to re-create the subscription at every `apply`.\n\n\u003e **NOTE:** If an SNS topic and SQS queue are in different AWS accounts and different AWS regions, the subscription needs to be initiated from the account with the SQS queue but in the region of the SNS topic.\n\n\u003e **NOTE:** You cannot unsubscribe to a subscription that is pending confirmation. If you use `email`, `email-json`, or `http`/`https` (without auto-confirmation enabled), until the subscription is confirmed (e.g., outside of this provider), AWS does not allow this provider to delete / unsubscribe the subscription. If you `destroy` an unconfirmed subscription, this provider will remove the subscription from its state but the subscription will still exist in AWS. However, if you delete an SNS topic, SNS [deletes all the subscriptions](https://docs.aws.amazon.com/sns/latest/dg/sns-delete-subscription-topic.html) associated with the topic. Also, you can import a subscription after confirmation and then have the capability to delete it.\n\n{{% examples %}}\n## Example Usage\n{{% example %}}\n\nYou can directly supply a topic and ARN by hand in the `topic_arn` property along with the queue ARN:\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as aws from \"@pulumi/aws\";\n\nconst userUpdatesSqsTarget = new aws.sns.TopicSubscription(\"userUpdatesSqsTarget\", {\n endpoint: \"arn:aws:sqs:us-west-2:432981146916:queue-too\",\n protocol: \"sqs\",\n topic: \"arn:aws:sns:us-west-2:432981146916:user-updates-topic\",\n});\n```\n```python\nimport pulumi\nimport pulumi_aws as aws\n\nuser_updates_sqs_target = aws.sns.TopicSubscription(\"userUpdatesSqsTarget\",\n endpoint=\"arn:aws:sqs:us-west-2:432981146916:queue-too\",\n protocol=\"sqs\",\n topic=\"arn:aws:sns:us-west-2:432981146916:user-updates-topic\")\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Aws = Pulumi.Aws;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var userUpdatesSqsTarget = new Aws.Sns.TopicSubscription(\"userUpdatesSqsTarget\", new()\n {\n Endpoint = \"arn:aws:sqs:us-west-2:432981146916:queue-too\",\n Protocol = \"sqs\",\n Topic = \"arn:aws:sns:us-west-2:432981146916:user-updates-topic\",\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/sns\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t_, err := sns.NewTopicSubscription(ctx, \"userUpdatesSqsTarget\", \u0026sns.TopicSubscriptionArgs{\n\t\t\tEndpoint: pulumi.String(\"arn:aws:sqs:us-west-2:432981146916:queue-too\"),\n\t\t\tProtocol: pulumi.String(\"sqs\"),\n\t\t\tTopic: pulumi.Any(\"arn:aws:sns:us-west-2:432981146916:user-updates-topic\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.aws.sns.TopicSubscription;\nimport com.pulumi.aws.sns.TopicSubscriptionArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n var userUpdatesSqsTarget = new TopicSubscription(\"userUpdatesSqsTarget\", TopicSubscriptionArgs.builder() \n .endpoint(\"arn:aws:sqs:us-west-2:432981146916:queue-too\")\n .protocol(\"sqs\")\n .topic(\"arn:aws:sns:us-west-2:432981146916:user-updates-topic\")\n .build());\n\n }\n}\n```\n```yaml\nresources:\n userUpdatesSqsTarget:\n type: aws:sns:TopicSubscription\n properties:\n endpoint: arn:aws:sqs:us-west-2:432981146916:queue-too\n protocol: sqs\n topic: arn:aws:sns:us-west-2:432981146916:user-updates-topic\n```\n\nAlternatively you can use the ARN properties of a managed SNS topic and SQS queue:\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as aws from \"@pulumi/aws\";\n\nconst userUpdates = new aws.sns.Topic(\"userUpdates\", {});\nconst userUpdatesQueue = new aws.sqs.Queue(\"userUpdatesQueue\", {});\nconst userUpdatesSqsTarget = new aws.sns.TopicSubscription(\"userUpdatesSqsTarget\", {\n topic: userUpdates.arn,\n protocol: \"sqs\",\n endpoint: userUpdatesQueue.arn,\n});\n```\n```python\nimport pulumi\nimport pulumi_aws as aws\n\nuser_updates = aws.sns.Topic(\"userUpdates\")\nuser_updates_queue = aws.sqs.Queue(\"userUpdatesQueue\")\nuser_updates_sqs_target = aws.sns.TopicSubscription(\"userUpdatesSqsTarget\",\n topic=user_updates.arn,\n protocol=\"sqs\",\n endpoint=user_updates_queue.arn)\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Aws = Pulumi.Aws;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var userUpdates = new Aws.Sns.Topic(\"userUpdates\");\n\n var userUpdatesQueue = new Aws.Sqs.Queue(\"userUpdatesQueue\");\n\n var userUpdatesSqsTarget = new Aws.Sns.TopicSubscription(\"userUpdatesSqsTarget\", new()\n {\n Topic = userUpdates.Arn,\n Protocol = \"sqs\",\n Endpoint = userUpdatesQueue.Arn,\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/sns\"\n\t\"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/sqs\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\tuserUpdates, err := sns.NewTopic(ctx, \"userUpdates\", nil)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tuserUpdatesQueue, err := sqs.NewQueue(ctx, \"userUpdatesQueue\", nil)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = sns.NewTopicSubscription(ctx, \"userUpdatesSqsTarget\", \u0026sns.TopicSubscriptionArgs{\n\t\t\tTopic: userUpdates.Arn,\n\t\t\tProtocol: pulumi.String(\"sqs\"),\n\t\t\tEndpoint: userUpdatesQueue.Arn,\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.aws.sns.Topic;\nimport com.pulumi.aws.sqs.Queue;\nimport com.pulumi.aws.sns.TopicSubscription;\nimport com.pulumi.aws.sns.TopicSubscriptionArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n var userUpdates = new Topic(\"userUpdates\");\n\n var userUpdatesQueue = new Queue(\"userUpdatesQueue\");\n\n var userUpdatesSqsTarget = new TopicSubscription(\"userUpdatesSqsTarget\", TopicSubscriptionArgs.builder() \n .topic(userUpdates.arn())\n .protocol(\"sqs\")\n .endpoint(userUpdatesQueue.arn())\n .build());\n\n }\n}\n```\n```yaml\nresources:\n userUpdates:\n type: aws:sns:Topic\n userUpdatesQueue:\n type: aws:sqs:Queue\n userUpdatesSqsTarget:\n type: aws:sns:TopicSubscription\n properties:\n topic: ${userUpdates.arn}\n protocol: sqs\n endpoint: ${userUpdatesQueue.arn}\n```\n\nYou can subscribe SNS topics to SQS queues in different Amazon accounts and regions:\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as aws from \"@pulumi/aws\";\n\nconst config = new pulumi.Config();\nconst sns = config.getObject\u003c{account-id?: string, display_name?: string, name?: string, region?: string, role-name?: string}\u003e(\"sns\") || {\n \"account-id\": \"111111111111\",\n \"role-name\": \"service/service\",\n name: \"example-sns-topic\",\n display_name: \"example\",\n region: \"us-west-1\",\n};\nconst sqs = config.getObject\u003c{account-id?: string, name?: string, region?: string, role-name?: string}\u003e(\"sqs\") || {\n \"account-id\": \"222222222222\",\n \"role-name\": \"service/service\",\n name: \"example-sqs-queue\",\n region: \"us-east-1\",\n};\nconst sns-topic-policy = aws.iam.getPolicyDocument({\n policyId: \"__default_policy_ID\",\n statements: [\n {\n actions: [\n \"SNS:Subscribe\",\n \"SNS:SetTopicAttributes\",\n \"SNS:RemovePermission\",\n \"SNS:Publish\",\n \"SNS:ListSubscriptionsByTopic\",\n \"SNS:GetTopicAttributes\",\n \"SNS:DeleteTopic\",\n \"SNS:AddPermission\",\n ],\n conditions: [{\n test: \"StringEquals\",\n variable: \"AWS:SourceOwner\",\n values: [sns[\"account-id\"]],\n }],\n effect: \"Allow\",\n principals: [{\n type: \"AWS\",\n identifiers: [\"*\"],\n }],\n resources: [`arn:aws:sns:${sns.region}:${sns[\"account-id\"]}:${sns.name}`],\n sid: \"__default_statement_ID\",\n },\n {\n actions: [\n \"SNS:Subscribe\",\n \"SNS:Receive\",\n ],\n conditions: [{\n test: \"StringLike\",\n variable: \"SNS:Endpoint\",\n values: [`arn:aws:sqs:${sqs.region}:${sqs[\"account-id\"]}:${sqs.name}`],\n }],\n effect: \"Allow\",\n principals: [{\n type: \"AWS\",\n identifiers: [\"*\"],\n }],\n resources: [`arn:aws:sns:${sns.region}:${sns[\"account-id\"]}:${sns.name}`],\n sid: \"__console_sub_0\",\n },\n ],\n});\nconst sqs-queue-policy = aws.iam.getPolicyDocument({\n policyId: `arn:aws:sqs:${sqs.region}:${sqs[\"account-id\"]}:${sqs.name}/SQSDefaultPolicy`,\n statements: [{\n sid: \"example-sns-topic\",\n effect: \"Allow\",\n principals: [{\n type: \"AWS\",\n identifiers: [\"*\"],\n }],\n actions: [\"SQS:SendMessage\"],\n resources: [`arn:aws:sqs:${sqs.region}:${sqs[\"account-id\"]}:${sqs.name}`],\n conditions: [{\n test: \"ArnEquals\",\n variable: \"aws:SourceArn\",\n values: [`arn:aws:sns:${sns.region}:${sns[\"account-id\"]}:${sns.name}`],\n }],\n }],\n});\n// provider to manage SNS topics\nconst awsSns = new aws.Provider(\"awsSns\", {\n region: sns.region,\n assumeRole: {\n roleArn: `arn:aws:iam::${sns[\"account-id\"]}:role/${sns[\"role-name\"]}`,\n sessionName: `sns-${sns.region}`,\n },\n});\n// provider to manage SQS queues\nconst awsSqs = new aws.Provider(\"awsSqs\", {\n region: sqs.region,\n assumeRole: {\n roleArn: `arn:aws:iam::${sqs[\"account-id\"]}:role/${sqs[\"role-name\"]}`,\n sessionName: `sqs-${sqs.region}`,\n },\n});\n// provider to subscribe SQS to SNS (using the SQS account but the SNS region)\nconst sns2sqs = new aws.Provider(\"sns2sqs\", {\n region: sns.region,\n assumeRole: {\n roleArn: `arn:aws:iam::${sqs[\"account-id\"]}:role/${sqs[\"role-name\"]}`,\n sessionName: `sns2sqs-${sns.region}`,\n },\n});\nconst sns_topicTopic = new aws.sns.Topic(\"sns-topicTopic\", {\n displayName: sns.display_name,\n policy: sns_topic_policy.then(sns_topic_policy =\u003e sns_topic_policy.json),\n}, {\n provider: aws.sns,\n});\nconst sqs_queue = new aws.sqs.Queue(\"sqs-queue\", {policy: sqs_queue_policy.then(sqs_queue_policy =\u003e sqs_queue_policy.json)}, {\n provider: aws.sqs,\n});\nconst sns_topicTopicSubscription = new aws.sns.TopicSubscription(\"sns-topicTopicSubscription\", {\n topic: sns_topicTopic.arn,\n protocol: \"sqs\",\n endpoint: sqs_queue.arn,\n}, {\n provider: aws.sns2sqs,\n});\n```\n```python\nimport pulumi\nimport pulumi_aws as aws\n\nconfig = pulumi.Config()\nsns = config.get_object(\"sns\")\nif sns is None:\n sns = {\n \"account-id\": \"111111111111\",\n \"role-name\": \"service/service\",\n \"name\": \"example-sns-topic\",\n \"display_name\": \"example\",\n \"region\": \"us-west-1\",\n }\nsqs = config.get_object(\"sqs\")\nif sqs is None:\n sqs = {\n \"account-id\": \"222222222222\",\n \"role-name\": \"service/service\",\n \"name\": \"example-sqs-queue\",\n \"region\": \"us-east-1\",\n }\nsns_topic_policy = aws.iam.get_policy_document(policy_id=\"__default_policy_ID\",\n statements=[\n aws.iam.GetPolicyDocumentStatementArgs(\n actions=[\n \"SNS:Subscribe\",\n \"SNS:SetTopicAttributes\",\n \"SNS:RemovePermission\",\n \"SNS:Publish\",\n \"SNS:ListSubscriptionsByTopic\",\n \"SNS:GetTopicAttributes\",\n \"SNS:DeleteTopic\",\n \"SNS:AddPermission\",\n ],\n conditions=[aws.iam.GetPolicyDocumentStatementConditionArgs(\n test=\"StringEquals\",\n variable=\"AWS:SourceOwner\",\n values=[sns[\"account-id\"]],\n )],\n effect=\"Allow\",\n principals=[aws.iam.GetPolicyDocumentStatementPrincipalArgs(\n type=\"AWS\",\n identifiers=[\"*\"],\n )],\n resources=[f\"arn:aws:sns:{sns['region']}:{sns['account-id']}:{sns['name']}\"],\n sid=\"__default_statement_ID\",\n ),\n aws.iam.GetPolicyDocumentStatementArgs(\n actions=[\n \"SNS:Subscribe\",\n \"SNS:Receive\",\n ],\n conditions=[aws.iam.GetPolicyDocumentStatementConditionArgs(\n test=\"StringLike\",\n variable=\"SNS:Endpoint\",\n values=[f\"arn:aws:sqs:{sqs['region']}:{sqs['account-id']}:{sqs['name']}\"],\n )],\n effect=\"Allow\",\n principals=[aws.iam.GetPolicyDocumentStatementPrincipalArgs(\n type=\"AWS\",\n identifiers=[\"*\"],\n )],\n resources=[f\"arn:aws:sns:{sns['region']}:{sns['account-id']}:{sns['name']}\"],\n sid=\"__console_sub_0\",\n ),\n ])\nsqs_queue_policy = aws.iam.get_policy_document(policy_id=f\"arn:aws:sqs:{sqs['region']}:{sqs['account-id']}:{sqs['name']}/SQSDefaultPolicy\",\n statements=[aws.iam.GetPolicyDocumentStatementArgs(\n sid=\"example-sns-topic\",\n effect=\"Allow\",\n principals=[aws.iam.GetPolicyDocumentStatementPrincipalArgs(\n type=\"AWS\",\n identifiers=[\"*\"],\n )],\n actions=[\"SQS:SendMessage\"],\n resources=[f\"arn:aws:sqs:{sqs['region']}:{sqs['account-id']}:{sqs['name']}\"],\n conditions=[aws.iam.GetPolicyDocumentStatementConditionArgs(\n test=\"ArnEquals\",\n variable=\"aws:SourceArn\",\n values=[f\"arn:aws:sns:{sns['region']}:{sns['account-id']}:{sns['name']}\"],\n )],\n )])\n# provider to manage SNS topics\naws_sns = aws.Provider(\"awsSns\",\n region=sns[\"region\"],\n assume_role=aws.ProviderAssumeRoleArgs(\n role_arn=f\"arn:aws:iam::{sns['account-id']}:role/{sns['role-name']}\",\n session_name=f\"sns-{sns['region']}\",\n ))\n# provider to manage SQS queues\naws_sqs = aws.Provider(\"awsSqs\",\n region=sqs[\"region\"],\n assume_role=aws.ProviderAssumeRoleArgs(\n role_arn=f\"arn:aws:iam::{sqs['account-id']}:role/{sqs['role-name']}\",\n session_name=f\"sqs-{sqs['region']}\",\n ))\n# provider to subscribe SQS to SNS (using the SQS account but the SNS region)\nsns2sqs = aws.Provider(\"sns2sqs\",\n region=sns[\"region\"],\n assume_role=aws.ProviderAssumeRoleArgs(\n role_arn=f\"arn:aws:iam::{sqs['account-id']}:role/{sqs['role-name']}\",\n session_name=f\"sns2sqs-{sns['region']}\",\n ))\nsns_topic_topic = aws.sns.Topic(\"sns-topicTopic\",\n display_name=sns[\"display_name\"],\n policy=sns_topic_policy.json,\n opts=pulumi.ResourceOptions(provider=aws[\"sns\"]))\nsqs_queue = aws.sqs.Queue(\"sqs-queue\", policy=sqs_queue_policy.json,\nopts=pulumi.ResourceOptions(provider=aws[\"sqs\"]))\nsns_topic_topic_subscription = aws.sns.TopicSubscription(\"sns-topicTopicSubscription\",\n topic=sns_topic_topic.arn,\n protocol=\"sqs\",\n endpoint=sqs_queue.arn,\n opts=pulumi.ResourceOptions(provider=aws[\"sns2sqs\"]))\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Aws = Pulumi.Aws;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var config = new Config();\n var sns = config.GetObject\u003cSns\u003e(\"sns\") ?? \n {\n { \"account-id\", \"111111111111\" },\n { \"role-name\", \"service/service\" },\n { \"name\", \"example-sns-topic\" },\n { \"display_name\", \"example\" },\n { \"region\", \"us-west-1\" },\n };\n var sqs = config.GetObject\u003cSqs\u003e(\"sqs\") ?? \n {\n { \"account-id\", \"222222222222\" },\n { \"role-name\", \"service/service\" },\n { \"name\", \"example-sqs-queue\" },\n { \"region\", \"us-east-1\" },\n };\n var sns_topic_policy = Aws.Iam.GetPolicyDocument.Invoke(new()\n {\n PolicyId = \"__default_policy_ID\",\n Statements = new[]\n {\n new Aws.Iam.Inputs.GetPolicyDocumentStatementInputArgs\n {\n Actions = new[]\n {\n \"SNS:Subscribe\",\n \"SNS:SetTopicAttributes\",\n \"SNS:RemovePermission\",\n \"SNS:Publish\",\n \"SNS:ListSubscriptionsByTopic\",\n \"SNS:GetTopicAttributes\",\n \"SNS:DeleteTopic\",\n \"SNS:AddPermission\",\n },\n Conditions = new[]\n {\n new Aws.Iam.Inputs.GetPolicyDocumentStatementConditionInputArgs\n {\n Test = \"StringEquals\",\n Variable = \"AWS:SourceOwner\",\n Values = new[]\n {\n sns.Account_id,\n },\n },\n },\n Effect = \"Allow\",\n Principals = new[]\n {\n new Aws.Iam.Inputs.GetPolicyDocumentStatementPrincipalInputArgs\n {\n Type = \"AWS\",\n Identifiers = new[]\n {\n \"*\",\n },\n },\n },\n Resources = new[]\n {\n $\"arn:aws:sns:{sns.Region}:{sns.Account_id}:{sns.Name}\",\n },\n Sid = \"__default_statement_ID\",\n },\n new Aws.Iam.Inputs.GetPolicyDocumentStatementInputArgs\n {\n Actions = new[]\n {\n \"SNS:Subscribe\",\n \"SNS:Receive\",\n },\n Conditions = new[]\n {\n new Aws.Iam.Inputs.GetPolicyDocumentStatementConditionInputArgs\n {\n Test = \"StringLike\",\n Variable = \"SNS:Endpoint\",\n Values = new[]\n {\n $\"arn:aws:sqs:{sqs.Region}:{sqs.Account_id}:{sqs.Name}\",\n },\n },\n },\n Effect = \"Allow\",\n Principals = new[]\n {\n new Aws.Iam.Inputs.GetPolicyDocumentStatementPrincipalInputArgs\n {\n Type = \"AWS\",\n Identifiers = new[]\n {\n \"*\",\n },\n },\n },\n Resources = new[]\n {\n $\"arn:aws:sns:{sns.Region}:{sns.Account_id}:{sns.Name}\",\n },\n Sid = \"__console_sub_0\",\n },\n },\n });\n\n var sqs_queue_policy = Aws.Iam.GetPolicyDocument.Invoke(new()\n {\n PolicyId = $\"arn:aws:sqs:{sqs.Region}:{sqs.Account_id}:{sqs.Name}/SQSDefaultPolicy\",\n Statements = new[]\n {\n new Aws.Iam.Inputs.GetPolicyDocumentStatementInputArgs\n {\n Sid = \"example-sns-topic\",\n Effect = \"Allow\",\n Principals = new[]\n {\n new Aws.Iam.Inputs.GetPolicyDocumentStatementPrincipalInputArgs\n {\n Type = \"AWS\",\n Identifiers = new[]\n {\n \"*\",\n },\n },\n },\n Actions = new[]\n {\n \"SQS:SendMessage\",\n },\n Resources = new[]\n {\n $\"arn:aws:sqs:{sqs.Region}:{sqs.Account_id}:{sqs.Name}\",\n },\n Conditions = new[]\n {\n new Aws.Iam.Inputs.GetPolicyDocumentStatementConditionInputArgs\n {\n Test = \"ArnEquals\",\n Variable = \"aws:SourceArn\",\n Values = new[]\n {\n $\"arn:aws:sns:{sns.Region}:{sns.Account_id}:{sns.Name}\",\n },\n },\n },\n },\n },\n });\n\n // provider to manage SNS topics\n var awsSns = new Aws.Provider(\"awsSns\", new()\n {\n Region = sns.Region,\n AssumeRole = new Aws.Inputs.ProviderAssumeRoleArgs\n {\n RoleArn = $\"arn:aws:iam::{sns.Account_id}:role/{sns.Role_name}\",\n SessionName = $\"sns-{sns.Region}\",\n },\n });\n\n // provider to manage SQS queues\n var awsSqs = new Aws.Provider(\"awsSqs\", new()\n {\n Region = sqs.Region,\n AssumeRole = new Aws.Inputs.ProviderAssumeRoleArgs\n {\n RoleArn = $\"arn:aws:iam::{sqs.Account_id}:role/{sqs.Role_name}\",\n SessionName = $\"sqs-{sqs.Region}\",\n },\n });\n\n // provider to subscribe SQS to SNS (using the SQS account but the SNS region)\n var sns2sqs = new Aws.Provider(\"sns2sqs\", new()\n {\n Region = sns.Region,\n AssumeRole = new Aws.Inputs.ProviderAssumeRoleArgs\n {\n RoleArn = $\"arn:aws:iam::{sqs.Account_id}:role/{sqs.Role_name}\",\n SessionName = $\"sns2sqs-{sns.Region}\",\n },\n });\n\n var sns_topicTopic = new Aws.Sns.Topic(\"sns-topicTopic\", new()\n {\n DisplayName = sns.Display_name,\n Policy = sns_topic_policy.Apply(sns_topic_policy =\u003e sns_topic_policy.Apply(getPolicyDocumentResult =\u003e getPolicyDocumentResult.Json)),\n }, new CustomResourceOptions\n {\n Provider = aws.Sns,\n });\n\n var sqs_queue = new Aws.Sqs.Queue(\"sqs-queue\", new()\n {\n Policy = sqs_queue_policy.Apply(sqs_queue_policy =\u003e sqs_queue_policy.Apply(getPolicyDocumentResult =\u003e getPolicyDocumentResult.Json)),\n }, new CustomResourceOptions\n {\n Provider = aws.Sqs,\n });\n\n var sns_topicTopicSubscription = new Aws.Sns.TopicSubscription(\"sns-topicTopicSubscription\", new()\n {\n Topic = sns_topicTopic.Arn,\n Protocol = \"sqs\",\n Endpoint = sqs_queue.Arn,\n }, new CustomResourceOptions\n {\n Provider = aws.Sns2sqs,\n });\n\n});\n\npublic class Sns\n{\n public string account-id { get; set; }\n public string display_name { get; set; }\n public string name { get; set; }\n public string region { get; set; }\n public string role-name { get; set; }\n}\n\npublic class Sqs\n{\n public string account-id { get; set; }\n public string name { get; set; }\n public string region { get; set; }\n public string role-name { get; set; }\n}\n```\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/pulumi/pulumi-aws/sdk/v6/go/aws\"\n\t\"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iam\"\n\t\"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/sns\"\n\t\"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/sqs\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config\"\n)\nfunc main() {\npulumi.Run(func(ctx *pulumi.Context) error {\ncfg := config.New(ctx, \"\")\nsns := map[string]interface{}{\n\"account-id\": \"111111111111\",\n\"role-name\": \"service/service\",\n\"name\": \"example-sns-topic\",\n\"display_name\": \"example\",\n\"region\": \"us-west-1\",\n};\nif param := cfg.GetObject(\"sns\"); param != nil {\nsns = param\n}\nsqs := map[string]interface{}{\n\"account-id\": \"222222222222\",\n\"role-name\": \"service/service\",\n\"name\": \"example-sqs-queue\",\n\"region\": \"us-east-1\",\n};\nif param := cfg.GetObject(\"sqs\"); param != nil {\nsqs = param\n}\nsns_topic_policy, err := iam.GetPolicyDocument(ctx, \u0026iam.GetPolicyDocumentArgs{\nPolicyId: pulumi.StringRef(\"__default_policy_ID\"),\nStatements: []iam.GetPolicyDocumentStatement{\n{\nActions: []string{\n\"SNS:Subscribe\",\n\"SNS:SetTopicAttributes\",\n\"SNS:RemovePermission\",\n\"SNS:Publish\",\n\"SNS:ListSubscriptionsByTopic\",\n\"SNS:GetTopicAttributes\",\n\"SNS:DeleteTopic\",\n\"SNS:AddPermission\",\n},\nConditions: []iam.GetPolicyDocumentStatementCondition{\n{\nTest: \"StringEquals\",\nVariable: \"AWS:SourceOwner\",\nValues: interface{}{\nsns.AccountId,\n},\n},\n},\nEffect: pulumi.StringRef(\"Allow\"),\nPrincipals: []iam.GetPolicyDocumentStatementPrincipal{\n{\nType: \"AWS\",\nIdentifiers: []string{\n\"*\",\n},\n},\n},\nResources: []string{\nfmt.Sprintf(\"arn:aws:sns:%v:%v:%v\", sns.Region, sns.AccountId, sns.Name),\n},\nSid: pulumi.StringRef(\"__default_statement_ID\"),\n},\n{\nActions: []string{\n\"SNS:Subscribe\",\n\"SNS:Receive\",\n},\nConditions: []iam.GetPolicyDocumentStatementCondition{\n{\nTest: \"StringLike\",\nVariable: \"SNS:Endpoint\",\nValues: []string{\nfmt.Sprintf(\"arn:aws:sqs:%v:%v:%v\", sqs.Region, sqs.AccountId, sqs.Name),\n},\n},\n},\nEffect: pulumi.StringRef(\"Allow\"),\nPrincipals: []iam.GetPolicyDocumentStatementPrincipal{\n{\nType: \"AWS\",\nIdentifiers: []string{\n\"*\",\n},\n},\n},\nResources: []string{\nfmt.Sprintf(\"arn:aws:sns:%v:%v:%v\", sns.Region, sns.AccountId, sns.Name),\n},\nSid: pulumi.StringRef(\"__console_sub_0\"),\n},\n},\n}, nil);\nif err != nil {\nreturn err\n}\nsqs_queue_policy, err := iam.GetPolicyDocument(ctx, \u0026iam.GetPolicyDocumentArgs{\nPolicyId: pulumi.StringRef(fmt.Sprintf(\"arn:aws:sqs:%v:%v:%v/SQSDefaultPolicy\", sqs.Region, sqs.AccountId, sqs.Name)),\nStatements: []iam.GetPolicyDocumentStatement{\n{\nSid: pulumi.StringRef(\"example-sns-topic\"),\nEffect: pulumi.StringRef(\"Allow\"),\nPrincipals: []iam.GetPolicyDocumentStatementPrincipal{\n{\nType: \"AWS\",\nIdentifiers: []string{\n\"*\",\n},\n},\n},\nActions: []string{\n\"SQS:SendMessage\",\n},\nResources: []string{\nfmt.Sprintf(\"arn:aws:sqs:%v:%v:%v\", sqs.Region, sqs.AccountId, sqs.Name),\n},\nConditions: []iam.GetPolicyDocumentStatementCondition{\n{\nTest: \"ArnEquals\",\nVariable: \"aws:SourceArn\",\nValues: []string{\nfmt.Sprintf(\"arn:aws:sns:%v:%v:%v\", sns.Region, sns.AccountId, sns.Name),\n},\n},\n},\n},\n},\n}, nil);\nif err != nil {\nreturn err\n}\n_, err = aws.NewProvider(ctx, \"awsSns\", \u0026aws.ProviderArgs{\nRegion: *pulumi.String(sns.Region),\nAssumeRole: \u0026aws.ProviderAssumeRoleArgs{\nRoleArn: pulumi.String(fmt.Sprintf(\"arn:aws:iam::%v:role/%v\", sns.AccountId, sns.RoleName)),\nSessionName: pulumi.String(fmt.Sprintf(\"sns-%v\", sns.Region)),\n},\n})\nif err != nil {\nreturn err\n}\n_, err = aws.NewProvider(ctx, \"awsSqs\", \u0026aws.ProviderArgs{\nRegion: *pulumi.String(sqs.Region),\nAssumeRole: \u0026aws.ProviderAssumeRoleArgs{\nRoleArn: pulumi.String(fmt.Sprintf(\"arn:aws:iam::%v:role/%v\", sqs.AccountId, sqs.RoleName)),\nSessionName: pulumi.String(fmt.Sprintf(\"sqs-%v\", sqs.Region)),\n},\n})\nif err != nil {\nreturn err\n}\n_, err = aws.NewProvider(ctx, \"sns2sqs\", \u0026aws.ProviderArgs{\nRegion: *pulumi.String(sns.Region),\nAssumeRole: \u0026aws.ProviderAssumeRoleArgs{\nRoleArn: pulumi.String(fmt.Sprintf(\"arn:aws:iam::%v:role/%v\", sqs.AccountId, sqs.RoleName)),\nSessionName: pulumi.String(fmt.Sprintf(\"sns2sqs-%v\", sns.Region)),\n},\n})\nif err != nil {\nreturn err\n}\n_, err = sns.NewTopic(ctx, \"sns-topicTopic\", \u0026sns.TopicArgs{\nDisplayName: *pulumi.String(sns.Display_name),\nPolicy: *pulumi.String(sns_topic_policy.Json),\n}, pulumi.Provider(aws.Sns))\nif err != nil {\nreturn err\n}\n_, err = sqs.NewQueue(ctx, \"sqs-queue\", \u0026sqs.QueueArgs{\nPolicy: *pulumi.String(sqs_queue_policy.Json),\n}, pulumi.Provider(aws.Sqs))\nif err != nil {\nreturn err\n}\n_, err = sns.NewTopicSubscription(ctx, \"sns-topicTopicSubscription\", \u0026sns.TopicSubscriptionArgs{\nTopic: sns_topicTopic.Arn,\nProtocol: pulumi.String(\"sqs\"),\nEndpoint: sqs_queue.Arn,\n}, pulumi.Provider(aws.Sns2sqs))\nif err != nil {\nreturn err\n}\nreturn nil\n})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.aws.iam.IamFunctions;\nimport com.pulumi.aws.iam.inputs.GetPolicyDocumentArgs;\nimport com.pulumi.aws.Provider;\nimport com.pulumi.aws.ProviderArgs;\nimport com.pulumi.aws.inputs.ProviderAssumeRoleArgs;\nimport com.pulumi.aws.sns.Topic;\nimport com.pulumi.aws.sns.TopicArgs;\nimport com.pulumi.aws.sqs.Queue;\nimport com.pulumi.aws.sqs.QueueArgs;\nimport com.pulumi.aws.sns.TopicSubscription;\nimport com.pulumi.aws.sns.TopicSubscriptionArgs;\nimport com.pulumi.resources.CustomResourceOptions;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n final var config = ctx.config();\n final var sns = config.get(\"sns\").orElse(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference));\n final var sqs = config.get(\"sqs\").orElse(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference));\n final var sns-topic-policy = IamFunctions.getPolicyDocument(GetPolicyDocumentArgs.builder()\n .policyId(\"__default_policy_ID\")\n .statements( \n GetPolicyDocumentStatementArgs.builder()\n .actions( \n \"SNS:Subscribe\",\n \"SNS:SetTopicAttributes\",\n \"SNS:RemovePermission\",\n \"SNS:Publish\",\n \"SNS:ListSubscriptionsByTopic\",\n \"SNS:GetTopicAttributes\",\n \"SNS:DeleteTopic\",\n \"SNS:AddPermission\")\n .conditions(GetPolicyDocumentStatementConditionArgs.builder()\n .test(\"StringEquals\")\n .variable(\"AWS:SourceOwner\")\n .values(sns.account-id())\n .build())\n .effect(\"Allow\")\n .principals(GetPolicyDocumentStatementPrincipalArgs.builder()\n .type(\"AWS\")\n .identifiers(\"*\")\n .build())\n .resources(String.format(\"arn:aws:sns:%s:%s:%s\", sns.region(),sns.account-id(),sns.name()))\n .sid(\"__default_statement_ID\")\n .build(),\n GetPolicyDocumentStatementArgs.builder()\n .actions( \n \"SNS:Subscribe\",\n \"SNS:Receive\")\n .conditions(GetPolicyDocumentStatementConditionArgs.builder()\n .test(\"StringLike\")\n .variable(\"SNS:Endpoint\")\n .values(String.format(\"arn:aws:sqs:%s:%s:%s\", sqs.region(),sqs.account-id(),sqs.name()))\n .build())\n .effect(\"Allow\")\n .principals(GetPolicyDocumentStatementPrincipalArgs.builder()\n .type(\"AWS\")\n .identifiers(\"*\")\n .build())\n .resources(String.format(\"arn:aws:sns:%s:%s:%s\", sns.region(),sns.account-id(),sns.name()))\n .sid(\"__console_sub_0\")\n .build())\n .build());\n\n final var sqs-queue-policy = IamFunctions.getPolicyDocument(GetPolicyDocumentArgs.builder()\n .policyId(String.format(\"arn:aws:sqs:%s:%s:%s/SQSDefaultPolicy\", sqs.region(),sqs.account-id(),sqs.name()))\n .statements(GetPolicyDocumentStatementArgs.builder()\n .sid(\"example-sns-topic\")\n .effect(\"Allow\")\n .principals(GetPolicyDocumentStatementPrincipalArgs.builder()\n .type(\"AWS\")\n .identifiers(\"*\")\n .build())\n .actions(\"SQS:SendMessage\")\n .resources(String.format(\"arn:aws:sqs:%s:%s:%s\", sqs.region(),sqs.account-id(),sqs.name()))\n .conditions(GetPolicyDocumentStatementConditionArgs.builder()\n .test(\"ArnEquals\")\n .variable(\"aws:SourceArn\")\n .values(String.format(\"arn:aws:sns:%s:%s:%s\", sns.region(),sns.account-id(),sns.name()))\n .build())\n .build())\n .build());\n\n var awsSns = new Provider(\"awsSns\", ProviderArgs.builder() \n .region(sns.region())\n .assumeRole(ProviderAssumeRoleArgs.builder()\n .roleArn(String.format(\"arn:aws:iam::%s:role/%s\", sns.account-id(),sns.role-name()))\n .sessionName(String.format(\"sns-%s\", sns.region()))\n .build())\n .build());\n\n var awsSqs = new Provider(\"awsSqs\", ProviderArgs.builder() \n .region(sqs.region())\n .assumeRole(ProviderAssumeRoleArgs.builder()\n .roleArn(String.format(\"arn:aws:iam::%s:role/%s\", sqs.account-id(),sqs.role-name()))\n .sessionName(String.format(\"sqs-%s\", sqs.region()))\n .build())\n .build());\n\n var sns2sqs = new Provider(\"sns2sqs\", ProviderArgs.builder() \n .region(sns.region())\n .assumeRole(ProviderAssumeRoleArgs.builder()\n .roleArn(String.format(\"arn:aws:iam::%s:role/%s\", sqs.account-id(),sqs.role-name()))\n .sessionName(String.format(\"sns2sqs-%s\", sns.region()))\n .build())\n .build());\n\n var sns_topicTopic = new Topic(\"sns-topicTopic\", TopicArgs.builder() \n .displayName(sns.display_name())\n .policy(sns_topic_policy.json())\n .build(), CustomResourceOptions.builder()\n .provider(aws.sns())\n .build());\n\n var sqs_queue = new Queue(\"sqs-queue\", QueueArgs.builder() \n .policy(sqs_queue_policy.json())\n .build(), CustomResourceOptions.builder()\n .provider(aws.sqs())\n .build());\n\n var sns_topicTopicSubscription = new TopicSubscription(\"sns-topicTopicSubscription\", TopicSubscriptionArgs.builder() \n .topic(sns_topicTopic.arn())\n .protocol(\"sqs\")\n .endpoint(sqs_queue.arn())\n .build(), CustomResourceOptions.builder()\n .provider(aws.sns2sqs())\n .build());\n\n }\n}\n```\n```yaml\nconfiguration:\n sns:\n type: object({account-id = union(none, string), display_name = union(none, string), name = union(none, string), region = union(none, string), role-name = union(none, string)})\n default:\n account-id: '111111111111'\n role-name: service/service\n name: example-sns-topic\n display_name: example\n region: us-west-1\n sqs:\n type: object({account-id = union(none, string), name = union(none, string), region = union(none, string), role-name = union(none, string)})\n default:\n account-id: '222222222222'\n role-name: service/service\n name: example-sqs-queue\n region: us-east-1\nresources:\n # provider to manage SNS topics\n awsSns:\n type: pulumi:providers:aws\n properties:\n region: ${sns.region}\n assumeRole:\n roleArn: arn:aws:iam::${sns\"account-id\"[%!s(MISSING)]}:role/${sns\"role-name\"[%!s(MISSING)]}\n sessionName: sns-${sns.region}\n # provider to manage SQS queues\n awsSqs:\n type: pulumi:providers:aws\n properties:\n region: ${sqs.region}\n assumeRole:\n roleArn: arn:aws:iam::${sqs\"account-id\"[%!s(MISSING)]}:role/${sqs\"role-name\"[%!s(MISSING)]}\n sessionName: sqs-${sqs.region}\n # provider to subscribe SQS to SNS (using the SQS account but the SNS region)\n sns2sqs:\n type: pulumi:providers:aws\n properties:\n region: ${sns.region}\n assumeRole:\n roleArn: arn:aws:iam::${sqs\"account-id\"[%!s(MISSING)]}:role/${sqs\"role-name\"[%!s(MISSING)]}\n sessionName: sns2sqs-${sns.region}\n sns-topicTopic:\n type: aws:sns:Topic\n properties:\n displayName: ${sns.display_name}\n policy: ${[\"sns-topic-policy\"].json}\n options:\n provider: ${aws.sns}\n sqs-queue:\n type: aws:sqs:Queue\n properties:\n policy: ${[\"sqs-queue-policy\"].json}\n options:\n provider: ${aws.sqs}\n sns-topicTopicSubscription:\n type: aws:sns:TopicSubscription\n properties:\n topic: ${[\"sns-topicTopic\"].arn}\n protocol: sqs\n endpoint: ${[\"sqs-queue\"].arn}\n options:\n provider: ${aws.sns2sqs}\nvariables:\n sns-topic-policy:\n fn::invoke:\n Function: aws:iam:getPolicyDocument\n Arguments:\n policyId: __default_policy_ID\n statements:\n - actions:\n - SNS:Subscribe\n - SNS:SetTopicAttributes\n - SNS:RemovePermission\n - SNS:Publish\n - SNS:ListSubscriptionsByTopic\n - SNS:GetTopicAttributes\n - SNS:DeleteTopic\n - SNS:AddPermission\n conditions:\n - test: StringEquals\n variable: AWS:SourceOwner\n values:\n - ${sns\"account-id\"[%!s(MISSING)]}\n effect: Allow\n principals:\n - type: AWS\n identifiers:\n - '*'\n resources:\n - arn:aws:sns:${sns.region}:${sns\"account-id\"[%!s(MISSING)]}:${sns.name}\n sid: __default_statement_ID\n - actions:\n - SNS:Subscribe\n - SNS:Receive\n conditions:\n - test: StringLike\n variable: SNS:Endpoint\n values:\n - arn:aws:sqs:${sqs.region}:${sqs\"account-id\"[%!s(MISSING)]}:${sqs.name}\n effect: Allow\n principals:\n - type: AWS\n identifiers:\n - '*'\n resources:\n - arn:aws:sns:${sns.region}:${sns\"account-id\"[%!s(MISSING)]}:${sns.name}\n sid: __console_sub_0\n sqs-queue-policy:\n fn::invoke:\n Function: aws:iam:getPolicyDocument\n Arguments:\n policyId: arn:aws:sqs:${sqs.region}:${sqs\"account-id\"[%!s(MISSING)]}:${sqs.name}/SQSDefaultPolicy\n statements:\n - sid: example-sns-topic\n effect: Allow\n principals:\n - type: AWS\n identifiers:\n - '*'\n actions:\n - SQS:SendMessage\n resources:\n - arn:aws:sqs:${sqs.region}:${sqs\"account-id\"[%!s(MISSING)]}:${sqs.name}\n conditions:\n - test: ArnEquals\n variable: aws:SourceArn\n values:\n - arn:aws:sns:${sns.region}:${sns\"account-id\"[%!s(MISSING)]}:${sns.name}\n```\n{{% /example %}}\n{{% /examples %}}\n\n## Import\n\nUsing `pulumi import`, import SNS Topic Subscriptions using the subscription `arn`. For example:\n\n```sh\n $ pulumi import aws:sns/topicSubscription:TopicSubscription user_updates_sqs_target arn:aws:sns:us-west-2:0123456789012:my-topic:8a21d249-4329-4871-acc6-7be709c6ea7f\n```\n ", "properties": { "arn": { "type": "string", diff --git a/provider/go.mod b/provider/go.mod index 9b0f87563c8..64d0aa46c66 100644 --- a/provider/go.mod +++ b/provider/go.mod @@ -12,7 +12,7 @@ require ( github.com/pulumi/pulumi-terraform-bridge/pf v0.22.0 github.com/pulumi/pulumi-terraform-bridge/v3 v3.69.0 github.com/pulumi/pulumi/pkg/v3 v3.98.0 - github.com/pulumi/pulumi/sdk/v3 v3.98.0 + github.com/pulumi/pulumi/sdk/v3 v3.99.0 github.com/stretchr/testify v1.8.4 pgregory.net/rapid v0.6.1 ) @@ -312,10 +312,10 @@ require ( github.com/pmezard/go-difflib v1.0.0 // indirect github.com/posener/complete v1.2.3 // indirect github.com/pulumi/appdash v0.0.0-20231130102222-75f619a67231 // indirect - github.com/pulumi/esc v0.6.1 // indirect + github.com/pulumi/esc v0.6.2 // indirect github.com/pulumi/pulumi-java/pkg v0.9.8 // indirect github.com/pulumi/pulumi-terraform-bridge/x/muxer v0.0.7-0.20231130182140-6385710fcbc4 // indirect - github.com/pulumi/pulumi-yaml v1.4.3 // indirect + github.com/pulumi/pulumi-yaml v1.4.4 // indirect github.com/pulumi/schema-tools v0.1.2 // indirect github.com/pulumi/terraform-diff-reader v0.0.2 // indirect github.com/rivo/uniseg v0.4.4 // indirect @@ -380,3 +380,7 @@ require ( gopkg.in/yaml.v3 v3.0.1 // indirect lukechampine.com/frand v1.4.2 // indirect ) + +replace github.com/pulumi/pulumi/pkg/v3 => github.com/pulumi/pulumi/pkg/v3 v3.78.2-0.20231225021323-11f3fe2b2a73 + +replace github.com/pulumi/pulumi/sdk/v3 => github.com/pulumi/pulumi/sdk/v3 v3.99.1-0.20231225021323-11f3fe2b2a73 diff --git a/provider/go.sum b/provider/go.sum index 2c238c58543..3bc9de37252 100644 --- a/provider/go.sum +++ b/provider/go.sum @@ -2415,8 +2415,8 @@ github.com/prometheus/prometheus v0.37.0/go.mod h1:egARUgz+K93zwqsVIAneFlLZefyGO github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/pulumi/appdash v0.0.0-20231130102222-75f619a67231 h1:vkHw5I/plNdTr435cARxCW6q9gc0S/Yxz7Mkd38pOb0= github.com/pulumi/appdash v0.0.0-20231130102222-75f619a67231/go.mod h1:murToZ2N9hNJzewjHBgfFdXhZKjY3z5cYC1VXk+lbFE= -github.com/pulumi/esc v0.6.1 h1:X6gRcw1cH/oNkZG8MuD4rUhetO7fUTGKZXPzQWAPX40= -github.com/pulumi/esc v0.6.1/go.mod h1:1+tlMNX29iqfyElwo0tc2eRx9MWjWHRjrPLyLvTQMqM= +github.com/pulumi/esc v0.6.2 h1:+z+l8cuwIauLSwXQS0uoI3rqB+YG4SzsZYtHfNoXBvw= +github.com/pulumi/esc v0.6.2/go.mod h1:jNnYNjzsOgVTjCp0LL24NsCk8ZJxq4IoLQdCT0X7l8k= github.com/pulumi/providertest v0.0.3 h1:DLcAvVGgeP4mHEi1Ftk5zTX9QHjcrO6u5w5GCZrF99s= github.com/pulumi/providertest v0.0.3/go.mod h1:kZYBA14iemv3X4G4xsBKaa72zVbn//IyL5HTYKpLuy0= github.com/pulumi/pulumi-java/pkg v0.9.8 h1:c8mYsalnRXA2Ibgvv6scefOn6mW1Vb0UT0mcDqjsivQ= @@ -2429,12 +2429,12 @@ github.com/pulumi/pulumi-terraform-bridge/v3 v3.69.0 h1:PsIB738ZqrQbHKe5Q5Ag8Kq/ github.com/pulumi/pulumi-terraform-bridge/v3 v3.69.0/go.mod h1:/wXhD95iSr4FlmGtVN/H8hXriMW4isDDrAUprozXG4A= github.com/pulumi/pulumi-terraform-bridge/x/muxer v0.0.7-0.20231130182140-6385710fcbc4 h1:8lK+vlRrnAxB6K3J2YIPAq50ETpvvWZ92vi66Hko/4o= github.com/pulumi/pulumi-terraform-bridge/x/muxer v0.0.7-0.20231130182140-6385710fcbc4/go.mod h1:F/fzVS4Ksc4SPPLtMjGFRM9M76QtM1Rc0CYGnHCHEwU= -github.com/pulumi/pulumi-yaml v1.4.3 h1:GO36c7FTl8If20Dn/w2Hi3huP7kmsO00KNaz3GJU0Ws= -github.com/pulumi/pulumi-yaml v1.4.3/go.mod h1:1hwsXFnT7hm2ZeftY5fzjkngjs2eT/rv9MsPE48Leb4= -github.com/pulumi/pulumi/pkg/v3 v3.98.0 h1:lQyjy31az5bMfTmsyqeeAEQMKjrLyx8IL+C27D6b+x4= -github.com/pulumi/pulumi/pkg/v3 v3.98.0/go.mod h1:aeQmrCMwvMOIz1s6qOk+vg1oCWff5hmeRrg1vYv8eRU= -github.com/pulumi/pulumi/sdk/v3 v3.98.0 h1:H18eCWKiv7oXy7n/dni3JxFfwvY3UEjAzjeqtaaZT+I= -github.com/pulumi/pulumi/sdk/v3 v3.98.0/go.mod h1:/bHwzPhsCJCjzY0STmvZ7DzV5gZN6iDSXQ/gitEAyws= +github.com/pulumi/pulumi-yaml v1.4.4 h1:BODM3hnmy/kjmbjxySNI5dmGURn2fczVql2MSGjdeQw= +github.com/pulumi/pulumi-yaml v1.4.4/go.mod h1:1hwsXFnT7hm2ZeftY5fzjkngjs2eT/rv9MsPE48Leb4= +github.com/pulumi/pulumi/pkg/v3 v3.78.2-0.20231225021323-11f3fe2b2a73 h1:Ks+E1DTJuwYFNKsgxNP16aqZS7esCdo2z9wx9hTUuFo= +github.com/pulumi/pulumi/pkg/v3 v3.78.2-0.20231225021323-11f3fe2b2a73/go.mod h1:Gk/N8qblqKI6+fTORH7oJi2SSWaOVTDhNwTrazoQPao= +github.com/pulumi/pulumi/sdk/v3 v3.99.1-0.20231225021323-11f3fe2b2a73 h1:0SXeZJ8WbMhQWYe5ULG0OT7SwfY53wyx13tBQ6975R4= +github.com/pulumi/pulumi/sdk/v3 v3.99.1-0.20231225021323-11f3fe2b2a73/go.mod h1:wFM/6iAMlidgLDSF9QU+p3P+B+vg/xloFyVeZrVwA1w= github.com/pulumi/schema-tools v0.1.2 h1:Fd9xvUjgck4NA+7/jSk7InqCUT4Kj940+EcnbQKpfZo= github.com/pulumi/schema-tools v0.1.2/go.mod h1:62lgj52Tzq11eqWTIaKd+EVyYAu5dEcDJxMhTjvMO/k= github.com/pulumi/terraform-diff-reader v0.0.2 h1:kTE4nEXU3/SYXESvAIem+wyHMI3abqkI3OhJ0G04LLI= diff --git a/sdk/go.mod b/sdk/go.mod index c1d3bd62b18..8beb57579a8 100644 --- a/sdk/go.mod +++ b/sdk/go.mod @@ -62,7 +62,7 @@ require ( github.com/pkg/errors v0.9.1 // indirect github.com/pkg/term v1.1.0 // indirect github.com/pulumi/appdash v0.0.0-20231130102222-75f619a67231 // indirect - github.com/pulumi/esc v0.6.1 // indirect + github.com/pulumi/esc v0.6.2 // indirect github.com/rivo/uniseg v0.4.4 // indirect github.com/rogpeppe/go-internal v1.11.0 // indirect github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 // indirect @@ -79,13 +79,13 @@ require ( github.com/xanzy/ssh-agent v0.3.3 // indirect github.com/zclconf/go-cty v1.13.2 // indirect go.uber.org/atomic v1.9.0 // indirect - golang.org/x/crypto v0.15.0 // indirect + golang.org/x/crypto v0.17.0 // indirect golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/sync v0.5.0 // indirect - golang.org/x/sys v0.14.0 // indirect - golang.org/x/term v0.14.0 // indirect + golang.org/x/sys v0.15.0 // indirect + golang.org/x/term v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/tools v0.15.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20230706204954-ccb25ca9f130 // indirect @@ -95,3 +95,7 @@ require ( gopkg.in/yaml.v3 v3.0.1 // indirect lukechampine.com/frand v1.4.2 // indirect ) + +replace github.com/pulumi/pulumi/pkg/v3 => github.com/pulumi/pulumi/pkg/v3 v3.78.2-0.20231225021323-11f3fe2b2a73 + +replace github.com/pulumi/pulumi/sdk/v3 => github.com/pulumi/pulumi/sdk/v3 v3.99.1-0.20231225021323-11f3fe2b2a73 diff --git a/sdk/go.sum b/sdk/go.sum index 15d3d43445c..c41dcc7f8e6 100644 --- a/sdk/go.sum +++ b/sdk/go.sum @@ -149,10 +149,10 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pulumi/appdash v0.0.0-20231130102222-75f619a67231 h1:vkHw5I/plNdTr435cARxCW6q9gc0S/Yxz7Mkd38pOb0= github.com/pulumi/appdash v0.0.0-20231130102222-75f619a67231/go.mod h1:murToZ2N9hNJzewjHBgfFdXhZKjY3z5cYC1VXk+lbFE= -github.com/pulumi/esc v0.6.1 h1:X6gRcw1cH/oNkZG8MuD4rUhetO7fUTGKZXPzQWAPX40= -github.com/pulumi/esc v0.6.1/go.mod h1:1+tlMNX29iqfyElwo0tc2eRx9MWjWHRjrPLyLvTQMqM= -github.com/pulumi/pulumi/sdk/v3 v3.98.0 h1:H18eCWKiv7oXy7n/dni3JxFfwvY3UEjAzjeqtaaZT+I= -github.com/pulumi/pulumi/sdk/v3 v3.98.0/go.mod h1:/bHwzPhsCJCjzY0STmvZ7DzV5gZN6iDSXQ/gitEAyws= +github.com/pulumi/esc v0.6.2 h1:+z+l8cuwIauLSwXQS0uoI3rqB+YG4SzsZYtHfNoXBvw= +github.com/pulumi/esc v0.6.2/go.mod h1:jNnYNjzsOgVTjCp0LL24NsCk8ZJxq4IoLQdCT0X7l8k= +github.com/pulumi/pulumi/sdk/v3 v3.99.1-0.20231225021323-11f3fe2b2a73 h1:0SXeZJ8WbMhQWYe5ULG0OT7SwfY53wyx13tBQ6975R4= +github.com/pulumi/pulumi/sdk/v3 v3.99.1-0.20231225021323-11f3fe2b2a73/go.mod h1:wFM/6iAMlidgLDSF9QU+p3P+B+vg/xloFyVeZrVwA1w= github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= @@ -208,8 +208,8 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA= -golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa h1:FRnLl4eNAQl8hwxVVC17teOw8kdjVDVAiFMtgUdTSRQ= golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa/go.mod h1:zk2irFbV9DP96SEBUUAy67IdHUaZuSnrz1n472HUCLE= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= @@ -260,15 +260,15 @@ golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q= -golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= +golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/term v0.14.0 h1:LGK9IlZ8T9jvdy6cTdfKUCltatMFOehAQo9SRC46UQ8= -golang.org/x/term v0.14.0/go.mod h1:TySc+nGkYR6qt8km8wUhuFRTVSMIX3XPR58y2lC8vww= +golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4= +golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= diff --git a/sdk/go/aws/s3control/multiRegionAccessPointPolicy.go b/sdk/go/aws/s3control/multiRegionAccessPointPolicy.go index 30bf571b222..d41740ef129 100644 --- a/sdk/go/aws/s3control/multiRegionAccessPointPolicy.go +++ b/sdk/go/aws/s3control/multiRegionAccessPointPolicy.go @@ -61,7 +61,7 @@ import ( // } // _, err = s3control.NewMultiRegionAccessPointPolicy(ctx, "exampleMultiRegionAccessPointPolicy", &s3control.MultiRegionAccessPointPolicyArgs{ // Details: &s3control.MultiRegionAccessPointPolicyDetailsArgs{ -// Name: "TODO: element", +// Name: "TODO: call element", // Policy: exampleMultiRegionAccessPoint.Alias.ApplyT(func(alias string) (pulumi.String, error) { // var _zero pulumi.String // tmpJSON0, err := json.Marshal(map[string]interface{}{ diff --git a/sdk/go/aws/sns/topicSubscription.go b/sdk/go/aws/sns/topicSubscription.go index 75cc5dfed54..152127ac039 100644 --- a/sdk/go/aws/sns/topicSubscription.go +++ b/sdk/go/aws/sns/topicSubscription.go @@ -118,7 +118,7 @@ import ( // "display_name": "example", // "region": "us-west-1", // }; -// if param := cfg.GetBool("sns"); param != nil { +// if param := cfg.GetObject("sns"); param != nil { // sns = param // } // sqs := map[string]interface{}{ @@ -127,7 +127,7 @@ import ( // "name": "example-sqs-queue", // "region": "us-east-1", // }; -// if param := cfg.GetBool("sqs"); param != nil { +// if param := cfg.GetObject("sqs"); param != nil { // sqs = param // } // sns_topic_policy, err := iam.GetPolicyDocument(ctx, &iam.GetPolicyDocumentArgs{