Skip to content

Commit 513119d

Browse files
committed
Updates aws_sqs_queue_policy
1 parent 157ad28 commit 513119d

File tree

4 files changed

+207
-16
lines changed

4 files changed

+207
-16
lines changed

internal/service/sqs/queue_policy.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@ import (
1212
)
1313

1414
// @SDKResource("aws_sqs_queue_policy", name="Queue Policy")
15-
// @IdentityAttribute("queue_url")
15+
// @IdentityVersion(1)
16+
// @CustomInherentRegionIdentity("queue_url", "parseQueueURL")
1617
// @Testing(preIdentityVersion="v6.9.0")
17-
// @Testing(idAttrDuplicates="queue_url")
1818
// @Testing(existsType="github.com/aws/aws-sdk-go-v2/service/sqs/types;awstypes;map[awstypes.QueueAttributeName]string")
19+
// @Testing(identityVersion="0;v6.10.0")
20+
// @Testing(identityVersion="1;v6.19.0")
1921
func resourceQueuePolicy() *schema.Resource {
2022
h := &queueAttributeHandler{
2123
AttributeName: types.QueueAttributeNamePolicy,

internal/service/sqs/queue_policy_identity_gen_test.go

Lines changed: 157 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/service/sqs/service_package_gen.go

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Copyright (c) HashiCorp, Inc.
2+
# SPDX-License-Identifier: MPL-2.0
3+
4+
resource "aws_sqs_queue_policy" "test" {
5+
queue_url = aws_sqs_queue.test.id
6+
7+
policy = <<POLICY
8+
{
9+
"Version": "2012-10-17",
10+
"Statement": [{
11+
"Effect": "Allow",
12+
"Principal": "*",
13+
"Action": "sqs:*",
14+
"Resource": "${aws_sqs_queue.test.arn}",
15+
"Condition": {
16+
"ArnEquals": {
17+
"aws:SourceArn": "${aws_sqs_queue.test.arn}"
18+
}
19+
}
20+
}]
21+
}
22+
POLICY
23+
}
24+
25+
resource "aws_sqs_queue" "test" {
26+
name = var.rName
27+
}
28+
29+
variable "rName" {
30+
description = "Name for resource"
31+
type = string
32+
nullable = false
33+
}
34+
terraform {
35+
required_providers {
36+
aws = {
37+
source = "hashicorp/aws"
38+
version = "6.18.0"
39+
}
40+
}
41+
}
42+
43+
provider "aws" {}

0 commit comments

Comments
 (0)