Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mq_broker: Tagging a broker on creation does not work #1832

Closed
1 task done
alinabuzachis opened this issue May 31, 2023 · 0 comments · Fixed by #1886
Closed
1 task done

mq_broker: Tagging a broker on creation does not work #1832

alinabuzachis opened this issue May 31, 2023 · 0 comments · Fixed by #1886

Comments

@alinabuzachis
Copy link
Contributor

alinabuzachis commented May 31, 2023

Summary

When creating a new MQ broker using the following task, the broker does not get tagged.

- name: create broker with minimal parameters
  mq_broker:
    broker_name: "{{ broker_name }}"
    security_groups: "{{ broker_sg_ids.split(',') }}"
    subnet_ids: "{{ broker_subnet_ids.split(',') }}"
    tags:
      "Foo": "Bar"
      "FooBar": "foobar"

Actual result:

changed: [testhost] => {
    "broker": {
        "broker_arn": "arn:aws:mq:us-east-1:123456789100:broker:ansible-test-52903175--mq:b-70e0807b-102d-42ae-8805-94ec6395436c",
        "broker_id": "b-70e0807b-102d-42ae-8805-94ec6395436c",
        "response_metadata": {
            "http_headers": {
                "access-control-allow-origin": "*",
                "access-control-expose-headers": "x-amzn-errortype,x-amzn-requestid,x-amzn-errormessage,x-amzn-trace-id,x-amz-apigw-id,date",
                "cache-control": "no-cache; no-store, must-revalidate, private",
                "connection": "keep-alive",
                "content-length": "191",
                "content-type": "application/json",
                "date": "Wed, 31 May 2023 13:25:16 GMT",
                "expires": "0",
                "pragma": "no-cache",
                "x-amz-apigw-id": "FyidUFppIAMF1zw=",
                "x-amzn-requestid": "12345bcb-5678-890d-972c-26a92712aaeb",
                "x-amzn-trace-id": "Root=1-64774abb-2b3bf58a2b0cbf7800afdef6"
            },
            "http_status_code": 200,
            "request_id": "59392bcb-5406-460d-972c-26a92712aaeb",
            "retry_attempts": 0
        }
    },

Issue Type

Bug Report

Component Name

mq_broker

Ansible Version

$ ansible --version

ansible [core 2.14.3]

Collection Versions

$ ansible-galaxy collection list

Collection                    Version
----------------------------- -------
amazon.aws                    6.0.0  
community.aws                 6.0.0  

AWS SDK versions

$ pip show boto boto3 botocore

Name: boto3
Version: 1.22.0
Summary: The AWS SDK for Python
Home-page: https://github.com/boto/boto3
Author: Amazon Web Services
Author-email: 
License: Apache License 2.0
Location: /Users/alinabuzachis/anaconda3/envs/py310/lib/python3.10/site-packages
Requires: botocore, jmespath, s3transfer
Required-by: gouttelette
---
Name: botocore
Version: 1.25.13
Summary: Low-level, data-driven core of boto 3.
Home-page: https://github.com/boto/botocore
Author: Amazon Web Services
Author-email: 
License: Apache License 2.0
Location: /Users/alinabuzachis/anaconda3/envs/py310/lib/python3.10/site-packages
Requires: jmespath, python-dateutil, urllib3
Required-by: aiobotocore, awscli, boto3, s3transfer

Configuration

$ ansible-config dump --only-changed

OS / Environment

No response

Steps to Reproduce

Expected Results

Create an MQ broker using the task I pasted before.

Actual Results

Code of Conduct

  • I agree to follow the Ansible Code of Conduct
alialkhalidi added a commit to alialkhalidi/community.aws that referenced this issue Jul 12, 2023
alialkhalidi added a commit to alialkhalidi/community.aws that referenced this issue Jul 19, 2023
alialkhalidi added a commit to alialkhalidi/community.aws that referenced this issue Sep 7, 2023
softwarefactory-project-zuul bot pushed a commit that referenced this issue Oct 20, 2023
mq_broker - fix creation with tags

SUMMARY
Fixes #1832
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
mq_broker
ADDITIONAL INFORMATION
before:
ok: [testhost] => {
    "result_c1": {
        "broker": {
            "authentication_strategy": "simple",
            "auto_minor_version_upgrade": true,
            "broker_arn": "arn:aws:mq:ca-central-1:196233192477:broker:ansible-test-22180167-ali-mq:b-ebaf0e8c-4414-4ac1-9517-67c7968e677d",
            "broker_id": "b-ebaf0e8c-4414-4ac1-9517-67c7968e677d",
            "broker_instances": [],
            "broker_name": "ansible-test-22180167-ali-mq",
            "broker_state": "CREATION_IN_PROGRESS",
            "configurations": {
                "history": [],
                "pending": {
                    "id": "c-2c5fc151-0091-4c1e-a590-096ffc633d07",
                    "revision": 1
                }
            },
            "created": "2023-07-12T10:02:38.207000+00:00",
            "deployment_mode": "SINGLE_INSTANCE",
            "encryption_options": {
                "kms_key_id": "arn:aws:kms:ca-central-1:196233192477:key/7cdaffb8-ad16-4623-b370-efb041df45cc",
                "use_aws_owned_key": false
            },
            "engine_type": "ActiveMQ",
            "engine_version": "5.17.3",
            "host_instance_type": "mq.t3.micro",
            "logs": {
                "audit": false,
                "audit_log_group": "/aws/amazonmq/broker/b-ebaf0e8c-4414-4ac1-9517-67c7968e677d/audit",
                "general": false,
                "general_log_group": "/aws/amazonmq/broker/b-ebaf0e8c-4414-4ac1-9517-67c7968e677d/general"
            },
            "maintenance_window_start_time": {
                "day_of_week": "TUESDAY",
                "time_of_day": "17:00",
                "time_zone": "UTC"
            },
            "publicly_accessible": false,
            "response_metadata": {
                "http_headers": {
                    "access-control-allow-origin": "*",
                    "access-control-expose-headers": "x-amzn-errortype,x-amzn-requestid,x-amzn-errormessage,x-amzn-trace-id,x-amz-apigw-id,date",
                    "cache-control": "no-cache; no-store, must-revalidate, private",
                    "connection": "keep-alive",
                    "content-length": "1784",
                    "content-type": "application/json",
                    "date": "Wed, 12 Jul 2023 10:02:40 GMT",
                    "expires": "0",
                    "pragma": "no-cache",
                    "x-amz-apigw-id": "H8gKCFJMYosFrgA=",
                    "x-amzn-requestid": "b7280747-8f0e-4c9f-9f32-e78b84eed485",
                    "x-amzn-trace-id": "Root=1-64ae7a3f-20b2061251100a3d6ed1f9a2"
                },
                "http_status_code": 200,
                "request_id": "b7280747-8f0e-4c9f-9f32-e78b84eed485",
                "retry_attempts": 0
            },
            "security_groups": [
                "sg-0aa726c0444fc83f7"
            ],
            "storage_type": "efs",
            "subnet_ids": [
                "subnet-0179f9e2489397b2e"
            ],
            "tags": {},
            "users": [
                {
                    "pending_change": "CREATE",
                    "username": "admin"
                }
            ]
        },
        "changed": false,
        "failed": false,
        "resource_actions": [
            "mq:DescribeBroker"
        ]
    }
}


after:
ok: [testhost] => {
    "result_c1": {
        "broker": {
            "authentication_strategy": "simple",
            "auto_minor_version_upgrade": true,
            "broker_arn": "arn:aws:mq:ca-central-1:196233192477:broker:ansible-test-25482350-ali-mq:b-3dd2d767-7740-4889-b004-62d771b36661",
            "broker_id": "b-3dd2d767-7740-4889-b004-62d771b36661",
            "broker_instances": [],
            "broker_name": "ansible-test-25482350-ali-mq",
            "broker_state": "CREATION_IN_PROGRESS",
            "configurations": {
                "history": [],
                "pending": {
                    "id": "c-6e226c2d-4ae1-4748-9720-b127ac041824",
                    "revision": 1
                }
            },
            "created": "2023-07-12T09:19:49.020000+00:00",
            "deployment_mode": "SINGLE_INSTANCE",
            "encryption_options": {
                "kms_key_id": "arn:aws:kms:ca-central-1:196233192477:key/7cdaffb8-ad16-4623-b370-efb041df45cc",
                "use_aws_owned_key": false
            },
            "engine_type": "ActiveMQ",
            "engine_version": "5.17.3",
            "host_instance_type": "mq.t3.micro",
            "logs": {
                "audit": false,
                "audit_log_group": "/aws/amazonmq/broker/b-3dd2d767-7740-4889-b004-62d771b36661/audit",
                "general": false,
                "general_log_group": "/aws/amazonmq/broker/b-3dd2d767-7740-4889-b004-62d771b36661/general"
            },
            "maintenance_window_start_time": {
                "day_of_week": "FRIDAY",
                "time_of_day": "17:00",
                "time_zone": "UTC"
            },
            "publicly_accessible": false,
            "response_metadata": {
                "http_headers": {
                    "access-control-allow-origin": "*",
                    "access-control-expose-headers": "x-amzn-errortype,x-amzn-requestid,x-amzn-errormessage,x-amzn-trace-id,x-amz-apigw-id,date",
                    "cache-control": "no-cache; no-store, must-revalidate, private",
                    "connection": "keep-alive",
                    "content-length": "1814",
                    "content-type": "application/json",
                    "date": "Wed, 12 Jul 2023 09:19:51 GMT",
                    "expires": "0",
                    "pragma": "no-cache",
                    "x-amz-apigw-id": "H8Z4pGfC4osFeAg=",
                    "x-amzn-requestid": "f469a522-80b7-4da4-af53-875f50962d2c",
                    "x-amzn-trace-id": "Root=1-64ae7037-43906aac58ab1798156f7003"
                },
                "http_status_code": 200,
                "request_id": "f469a522-80b7-4da4-af53-875f50962d2c",
                "retry_attempts": 0
            },
            "security_groups": [
                "sg-0e83937e543dc249c"
            ],
            "storage_type": "efs",
            "subnet_ids": [
                "subnet-054a759ac833bf4b3"
            ],
            "tags": {
                "workload_type": "other"
            },
            "users": [
                {
                    "pending_change": "CREATE",
                    "username": "admin"
                }
            ]
        },
        "changed": false,
        "failed": false,
        "resource_actions": [
            "mq:DescribeBroker"
        ]
    }
}

Reviewed-by: Alina Buzachis
patchback bot pushed a commit that referenced this issue Oct 20, 2023
mq_broker - fix creation with tags

SUMMARY
Fixes #1832
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
mq_broker
ADDITIONAL INFORMATION
before:
ok: [testhost] => {
    "result_c1": {
        "broker": {
            "authentication_strategy": "simple",
            "auto_minor_version_upgrade": true,
            "broker_arn": "arn:aws:mq:ca-central-1:196233192477:broker:ansible-test-22180167-ali-mq:b-ebaf0e8c-4414-4ac1-9517-67c7968e677d",
            "broker_id": "b-ebaf0e8c-4414-4ac1-9517-67c7968e677d",
            "broker_instances": [],
            "broker_name": "ansible-test-22180167-ali-mq",
            "broker_state": "CREATION_IN_PROGRESS",
            "configurations": {
                "history": [],
                "pending": {
                    "id": "c-2c5fc151-0091-4c1e-a590-096ffc633d07",
                    "revision": 1
                }
            },
            "created": "2023-07-12T10:02:38.207000+00:00",
            "deployment_mode": "SINGLE_INSTANCE",
            "encryption_options": {
                "kms_key_id": "arn:aws:kms:ca-central-1:196233192477:key/7cdaffb8-ad16-4623-b370-efb041df45cc",
                "use_aws_owned_key": false
            },
            "engine_type": "ActiveMQ",
            "engine_version": "5.17.3",
            "host_instance_type": "mq.t3.micro",
            "logs": {
                "audit": false,
                "audit_log_group": "/aws/amazonmq/broker/b-ebaf0e8c-4414-4ac1-9517-67c7968e677d/audit",
                "general": false,
                "general_log_group": "/aws/amazonmq/broker/b-ebaf0e8c-4414-4ac1-9517-67c7968e677d/general"
            },
            "maintenance_window_start_time": {
                "day_of_week": "TUESDAY",
                "time_of_day": "17:00",
                "time_zone": "UTC"
            },
            "publicly_accessible": false,
            "response_metadata": {
                "http_headers": {
                    "access-control-allow-origin": "*",
                    "access-control-expose-headers": "x-amzn-errortype,x-amzn-requestid,x-amzn-errormessage,x-amzn-trace-id,x-amz-apigw-id,date",
                    "cache-control": "no-cache; no-store, must-revalidate, private",
                    "connection": "keep-alive",
                    "content-length": "1784",
                    "content-type": "application/json",
                    "date": "Wed, 12 Jul 2023 10:02:40 GMT",
                    "expires": "0",
                    "pragma": "no-cache",
                    "x-amz-apigw-id": "H8gKCFJMYosFrgA=",
                    "x-amzn-requestid": "b7280747-8f0e-4c9f-9f32-e78b84eed485",
                    "x-amzn-trace-id": "Root=1-64ae7a3f-20b2061251100a3d6ed1f9a2"
                },
                "http_status_code": 200,
                "request_id": "b7280747-8f0e-4c9f-9f32-e78b84eed485",
                "retry_attempts": 0
            },
            "security_groups": [
                "sg-0aa726c0444fc83f7"
            ],
            "storage_type": "efs",
            "subnet_ids": [
                "subnet-0179f9e2489397b2e"
            ],
            "tags": {},
            "users": [
                {
                    "pending_change": "CREATE",
                    "username": "admin"
                }
            ]
        },
        "changed": false,
        "failed": false,
        "resource_actions": [
            "mq:DescribeBroker"
        ]
    }
}

after:
ok: [testhost] => {
    "result_c1": {
        "broker": {
            "authentication_strategy": "simple",
            "auto_minor_version_upgrade": true,
            "broker_arn": "arn:aws:mq:ca-central-1:196233192477:broker:ansible-test-25482350-ali-mq:b-3dd2d767-7740-4889-b004-62d771b36661",
            "broker_id": "b-3dd2d767-7740-4889-b004-62d771b36661",
            "broker_instances": [],
            "broker_name": "ansible-test-25482350-ali-mq",
            "broker_state": "CREATION_IN_PROGRESS",
            "configurations": {
                "history": [],
                "pending": {
                    "id": "c-6e226c2d-4ae1-4748-9720-b127ac041824",
                    "revision": 1
                }
            },
            "created": "2023-07-12T09:19:49.020000+00:00",
            "deployment_mode": "SINGLE_INSTANCE",
            "encryption_options": {
                "kms_key_id": "arn:aws:kms:ca-central-1:196233192477:key/7cdaffb8-ad16-4623-b370-efb041df45cc",
                "use_aws_owned_key": false
            },
            "engine_type": "ActiveMQ",
            "engine_version": "5.17.3",
            "host_instance_type": "mq.t3.micro",
            "logs": {
                "audit": false,
                "audit_log_group": "/aws/amazonmq/broker/b-3dd2d767-7740-4889-b004-62d771b36661/audit",
                "general": false,
                "general_log_group": "/aws/amazonmq/broker/b-3dd2d767-7740-4889-b004-62d771b36661/general"
            },
            "maintenance_window_start_time": {
                "day_of_week": "FRIDAY",
                "time_of_day": "17:00",
                "time_zone": "UTC"
            },
            "publicly_accessible": false,
            "response_metadata": {
                "http_headers": {
                    "access-control-allow-origin": "*",
                    "access-control-expose-headers": "x-amzn-errortype,x-amzn-requestid,x-amzn-errormessage,x-amzn-trace-id,x-amz-apigw-id,date",
                    "cache-control": "no-cache; no-store, must-revalidate, private",
                    "connection": "keep-alive",
                    "content-length": "1814",
                    "content-type": "application/json",
                    "date": "Wed, 12 Jul 2023 09:19:51 GMT",
                    "expires": "0",
                    "pragma": "no-cache",
                    "x-amz-apigw-id": "H8Z4pGfC4osFeAg=",
                    "x-amzn-requestid": "f469a522-80b7-4da4-af53-875f50962d2c",
                    "x-amzn-trace-id": "Root=1-64ae7037-43906aac58ab1798156f7003"
                },
                "http_status_code": 200,
                "request_id": "f469a522-80b7-4da4-af53-875f50962d2c",
                "retry_attempts": 0
            },
            "security_groups": [
                "sg-0e83937e543dc249c"
            ],
            "storage_type": "efs",
            "subnet_ids": [
                "subnet-054a759ac833bf4b3"
            ],
            "tags": {
                "workload_type": "other"
            },
            "users": [
                {
                    "pending_change": "CREATE",
                    "username": "admin"
                }
            ]
        },
        "changed": false,
        "failed": false,
        "resource_actions": [
            "mq:DescribeBroker"
        ]
    }
}

Reviewed-by: Alina Buzachis
(cherry picked from commit 9c85fec)
softwarefactory-project-zuul bot pushed a commit that referenced this issue Oct 20, 2023
[PR #1886/9c85fec7 backport][stable-6] mq_broker - fix creation with tags

This is a backport of PR #1886 as merged into main (9c85fec).
SUMMARY
Fixes #1832
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
mq_broker
ADDITIONAL INFORMATION
before:
ok: [testhost] => {
    "result_c1": {
        "broker": {
            "authentication_strategy": "simple",
            "auto_minor_version_upgrade": true,
            "broker_arn": "arn:aws:mq:ca-central-1:196233192477:broker:ansible-test-22180167-ali-mq:b-ebaf0e8c-4414-4ac1-9517-67c7968e677d",
            "broker_id": "b-ebaf0e8c-4414-4ac1-9517-67c7968e677d",
            "broker_instances": [],
            "broker_name": "ansible-test-22180167-ali-mq",
            "broker_state": "CREATION_IN_PROGRESS",
            "configurations": {
                "history": [],
                "pending": {
                    "id": "c-2c5fc151-0091-4c1e-a590-096ffc633d07",
                    "revision": 1
                }
            },
            "created": "2023-07-12T10:02:38.207000+00:00",
            "deployment_mode": "SINGLE_INSTANCE",
            "encryption_options": {
                "kms_key_id": "arn:aws:kms:ca-central-1:196233192477:key/7cdaffb8-ad16-4623-b370-efb041df45cc",
                "use_aws_owned_key": false
            },
            "engine_type": "ActiveMQ",
            "engine_version": "5.17.3",
            "host_instance_type": "mq.t3.micro",
            "logs": {
                "audit": false,
                "audit_log_group": "/aws/amazonmq/broker/b-ebaf0e8c-4414-4ac1-9517-67c7968e677d/audit",
                "general": false,
                "general_log_group": "/aws/amazonmq/broker/b-ebaf0e8c-4414-4ac1-9517-67c7968e677d/general"
            },
            "maintenance_window_start_time": {
                "day_of_week": "TUESDAY",
                "time_of_day": "17:00",
                "time_zone": "UTC"
            },
            "publicly_accessible": false,
            "response_metadata": {
                "http_headers": {
                    "access-control-allow-origin": "*",
                    "access-control-expose-headers": "x-amzn-errortype,x-amzn-requestid,x-amzn-errormessage,x-amzn-trace-id,x-amz-apigw-id,date",
                    "cache-control": "no-cache; no-store, must-revalidate, private",
                    "connection": "keep-alive",
                    "content-length": "1784",
                    "content-type": "application/json",
                    "date": "Wed, 12 Jul 2023 10:02:40 GMT",
                    "expires": "0",
                    "pragma": "no-cache",
                    "x-amz-apigw-id": "H8gKCFJMYosFrgA=",
                    "x-amzn-requestid": "b7280747-8f0e-4c9f-9f32-e78b84eed485",
                    "x-amzn-trace-id": "Root=1-64ae7a3f-20b2061251100a3d6ed1f9a2"
                },
                "http_status_code": 200,
                "request_id": "b7280747-8f0e-4c9f-9f32-e78b84eed485",
                "retry_attempts": 0
            },
            "security_groups": [
                "sg-0aa726c0444fc83f7"
            ],
            "storage_type": "efs",
            "subnet_ids": [
                "subnet-0179f9e2489397b2e"
            ],
            "tags": {},
            "users": [
                {
                    "pending_change": "CREATE",
                    "username": "admin"
                }
            ]
        },
        "changed": false,
        "failed": false,
        "resource_actions": [
            "mq:DescribeBroker"
        ]
    }
}


after:
ok: [testhost] => {
    "result_c1": {
        "broker": {
            "authentication_strategy": "simple",
            "auto_minor_version_upgrade": true,
            "broker_arn": "arn:aws:mq:ca-central-1:196233192477:broker:ansible-test-25482350-ali-mq:b-3dd2d767-7740-4889-b004-62d771b36661",
            "broker_id": "b-3dd2d767-7740-4889-b004-62d771b36661",
            "broker_instances": [],
            "broker_name": "ansible-test-25482350-ali-mq",
            "broker_state": "CREATION_IN_PROGRESS",
            "configurations": {
                "history": [],
                "pending": {
                    "id": "c-6e226c2d-4ae1-4748-9720-b127ac041824",
                    "revision": 1
                }
            },
            "created": "2023-07-12T09:19:49.020000+00:00",
            "deployment_mode": "SINGLE_INSTANCE",
            "encryption_options": {
                "kms_key_id": "arn:aws:kms:ca-central-1:196233192477:key/7cdaffb8-ad16-4623-b370-efb041df45cc",
                "use_aws_owned_key": false
            },
            "engine_type": "ActiveMQ",
            "engine_version": "5.17.3",
            "host_instance_type": "mq.t3.micro",
            "logs": {
                "audit": false,
                "audit_log_group": "/aws/amazonmq/broker/b-3dd2d767-7740-4889-b004-62d771b36661/audit",
                "general": false,
                "general_log_group": "/aws/amazonmq/broker/b-3dd2d767-7740-4889-b004-62d771b36661/general"
            },
            "maintenance_window_start_time": {
                "day_of_week": "FRIDAY",
                "time_of_day": "17:00",
                "time_zone": "UTC"
            },
            "publicly_accessible": false,
            "response_metadata": {
                "http_headers": {
                    "access-control-allow-origin": "*",
                    "access-control-expose-headers": "x-amzn-errortype,x-amzn-requestid,x-amzn-errormessage,x-amzn-trace-id,x-amz-apigw-id,date",
                    "cache-control": "no-cache; no-store, must-revalidate, private",
                    "connection": "keep-alive",
                    "content-length": "1814",
                    "content-type": "application/json",
                    "date": "Wed, 12 Jul 2023 09:19:51 GMT",
                    "expires": "0",
                    "pragma": "no-cache",
                    "x-amz-apigw-id": "H8Z4pGfC4osFeAg=",
                    "x-amzn-requestid": "f469a522-80b7-4da4-af53-875f50962d2c",
                    "x-amzn-trace-id": "Root=1-64ae7037-43906aac58ab1798156f7003"
                },
                "http_status_code": 200,
                "request_id": "f469a522-80b7-4da4-af53-875f50962d2c",
                "retry_attempts": 0
            },
            "security_groups": [
                "sg-0e83937e543dc249c"
            ],
            "storage_type": "efs",
            "subnet_ids": [
                "subnet-054a759ac833bf4b3"
            ],
            "tags": {
                "workload_type": "other"
            },
            "users": [
                {
                    "pending_change": "CREATE",
                    "username": "admin"
                }
            ]
        },
        "changed": false,
        "failed": false,
        "resource_actions": [
            "mq:DescribeBroker"
        ]
    }
}

Reviewed-by: Mark Chappell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant