-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Open
Labels
aws:sqsAmazon Simple Queue ServiceAmazon Simple Queue Servicestatus: backlogTriaged but not yet being worked onTriaged but not yet being worked ontype: bugBug reportBug report
Description
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
terraform-provider-aws/internal/service/sqs/queue_test.go::TestAccSQSQueue_encryption fails. It seems due to SqsManagedSseEnabled not being returned propery set once a KmsMasterKeyId is set.
>> match key: get-all-attributes-with-redrive-allow-and-kms
(~) /Attributes/SqsManagedSseEnabled 'false' → 'true' ... (expected → actual)
Ignore list (please keep in mind list indices might not work and should be replaced):
["$..Attributes.SqsManagedSseEnabled"]
Snapshot test:
@markers.aws.validated
def test_get_queue_attributes_round_trips_attributes_set_on_create(
self, sqs_create_queue, aws_client, snapshot
):
source_queue = sqs_create_queue(QueueName=f"queue-{short_uid()}")
source_attrs = aws_client.sqs.get_queue_attributes(
QueueUrl=source_queue, AttributeNames=["QueueArn"]
)
redrive_allow_policy = {
"redrivePermission": "byQueue",
"sourceQueueArns": [source_attrs["Attributes"]["QueueArn"]],
}
target_queue = sqs_create_queue(
QueueName=f"queue-{short_uid()}",
Attributes={
"RedriveAllowPolicy": json.dumps(redrive_allow_policy),
"KmsMasterKeyId": "alias/aws/sqs",
"KmsDataKeyReusePeriodSeconds": "600",
},
)
snapshot.add_transformer(
snapshot.transform.regex(source_queue.split("/")[-1], "<source-queue-name>")
)
snapshot.add_transformer(
snapshot.transform.regex(target_queue.split("/")[-1], "<target-queue-name>")
)
snapshot.add_transformer(
snapshot.transform.regex(
source_attrs["Attributes"]["QueueArn"],
"arn:<partition>:sqs:<region>:<account-id>:<source-queue-name>",
)
)
single_attribute = aws_client.sqs.get_queue_attributes(
QueueUrl=target_queue, AttributeNames=["RedriveAllowPolicy"]
)
snapshot.match("get-redrive-allow-policy", single_attribute)
all_attributes = aws_client.sqs.get_queue_attributes(
QueueUrl=target_queue, AttributeNames=["All"]
)
snapshot.match("get-all-attributes-with-redrive-allow-and-kms", all_attributes)Expected Behavior
Snapshot test to pass
How are you starting LocalStack?
From source.
Steps To Reproduce
- Run
python -m pytest -vvv terraform-provider-aws/internal/service/sqs/queue_test.go::TestAccSQSQueue_encryptionin terraform testsuite - Run above snapsthot test
Metadata
Metadata
Assignees
Labels
aws:sqsAmazon Simple Queue ServiceAmazon Simple Queue Servicestatus: backlogTriaged but not yet being worked onTriaged but not yet being worked ontype: bugBug reportBug report