From cab7437e32142b643c94f1206f58e558875d6b1f Mon Sep 17 00:00:00 2001 From: Mike Mochan Date: Sun, 8 May 2016 14:52:31 +1000 Subject: [PATCH] added tagging for the remote account --- cloud/amazon/ec2_vpc_peer.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cloud/amazon/ec2_vpc_peer.py b/cloud/amazon/ec2_vpc_peer.py index b8160d4676e..b21c2b708b9 100644 --- a/cloud/amazon/ec2_vpc_peer.py +++ b/cloud/amazon/ec2_vpc_peer.py @@ -150,7 +150,10 @@ EXAMPLES = ''' peering_id: "{{ vpc_peer.peering_id }}" profile: bot03_profile_for_cross_account state: accept - + tags: + Name: Peering conenction for VPC 21 to VPC 22 + CostCode: CC1234 + Project: phoenix # Complete example to create and reject a cross account peering connection. - name: Create cross account VPC peering Connection @@ -281,6 +284,8 @@ def accept_reject_delete(state, client, module): if state == 'absent' or peer_status(client, module) != 'active': try: invocations[state](**params) + if module.params.get('tags'): + create_tags(params['VpcPeeringConnectionId'], client, module) changed = True except botocore.exceptions.ClientError as e: module.fail_json(msg=str(e))