diff --git a/plugins/modules/aws_acm.py b/plugins/modules/aws_acm.py index 3e24adfd364..3229eb0c98b 100644 --- a/plugins/modules/aws_acm.py +++ b/plugins/modules/aws_acm.py @@ -160,14 +160,14 @@ EXAMPLES = ''' - name: upload a self-signed certificate - aws_acm: + community.aws.aws_acm: certificate: "{{ lookup('file', 'cert.pem' ) }}" privateKey: "{{ lookup('file', 'key.pem' ) }}" name_tag: my_cert # to be applied through an AWS tag as "Name":"my_cert" region: ap-southeast-2 # AWS region - name: create/update a certificate with a chain - aws_acm: + community.aws.aws_acm: certificate: "{{ lookup('file', 'cert.pem' ) }}" privateKey: "{{ lookup('file', 'key.pem' ) }}" name_tag: my_cert @@ -181,19 +181,19 @@ var: cert_create.certificate.arn - name: delete the cert we just created - aws_acm: + community.aws.aws_acm: name_tag: my_cert state: absent region: ap-southeast-2 - name: delete a certificate with a particular ARN - aws_acm: + community.aws.aws_acm: certificate_arn: "arn:aws:acm:ap-southeast-2:123456789012:certificate/01234567-abcd-abcd-abcd-012345678901" state: absent region: ap-southeast-2 - name: delete all certificates with a particular domain name - aws_acm: + community.aws.aws_acm: domain_name: acm.ansible.com state: absent region: ap-southeast-2 diff --git a/plugins/modules/aws_acm_info.py b/plugins/modules/aws_acm_info.py index 094d8a2ac6c..1f3d54b6b77 100644 --- a/plugins/modules/aws_acm_info.py +++ b/plugins/modules/aws_acm_info.py @@ -53,19 +53,19 @@ EXAMPLES = ''' - name: obtain all ACM certificates - aws_acm_info: + community.aws.aws_acm_info: - name: obtain all information for a single ACM certificate - aws_acm_info: + community.aws.aws_acm_info: domain_name: "*.example_com" - name: obtain all certificates pending validation - aws_acm_info: + community.aws.aws_acm_info: statuses: - PENDING_VALIDATION - name: obtain all certificates with tag Name=foo and myTag=bar - aws_acm_info: + community.aws.aws_acm_info: tags: Name: foo myTag: bar @@ -73,7 +73,7 @@ # The output is still a list of certificates, just one item long. - name: obtain information about a certificate with a particular ARN - aws_acm_info: + community.aws.aws_acm_info: certificate_arn: "arn:aws:acm:ap-southeast-2:123456789876:certificate/abcdeabc-abcd-1234-4321-abcdeabcde12" ''' diff --git a/plugins/modules/aws_api_gateway.py b/plugins/modules/aws_api_gateway.py index fe3cd969e6f..0dda39f06f1 100644 --- a/plugins/modules/aws_api_gateway.py +++ b/plugins/modules/aws_api_gateway.py @@ -120,7 +120,7 @@ EXAMPLES = ''' - name: Setup AWS API Gateway setup on AWS and deploy API definition - aws_api_gateway: + community.aws.aws_api_gateway: swagger_file: my_api.yml stage: production cache_enabled: true @@ -130,7 +130,7 @@ state: present - name: Update API definition to deploy new version - aws_api_gateway: + community.aws.aws_api_gateway: api_id: 'abc123321cba' swagger_file: my_api.yml deploy_desc: Make auth fix available. @@ -140,7 +140,7 @@ state: present - name: Update API definitions and settings and deploy as canary - aws_api_gateway: + community.aws.aws_api_gateway: api_id: 'abc123321cba' swagger_file: my_api.yml cache_enabled: true diff --git a/plugins/modules/aws_application_scaling_policy.py b/plugins/modules/aws_application_scaling_policy.py index 6fefaee2c3d..2590f8356e0 100644 --- a/plugins/modules/aws_application_scaling_policy.py +++ b/plugins/modules/aws_application_scaling_policy.py @@ -115,7 +115,7 @@ # Create step scaling policy for ECS Service - name: scaling_policy - aws_application_scaling_policy: + community.aws.aws_application_scaling_policy: state: present policy_name: test_policy service_namespace: ecs @@ -136,7 +136,7 @@ # Create target tracking scaling policy for ECS Service - name: scaling_policy - aws_application_scaling_policy: + community.aws.aws_application_scaling_policy: state: present policy_name: test_policy service_namespace: ecs @@ -154,7 +154,7 @@ # Remove scalable target for ECS Service - name: scaling_policy - aws_application_scaling_policy: + community.aws.aws_application_scaling_policy: state: absent policy_name: test_policy policy_type: StepScaling diff --git a/plugins/modules/aws_batch_compute_environment.py b/plugins/modules/aws_batch_compute_environment.py index 6329bba214c..738a7a0d14b 100644 --- a/plugins/modules/aws_batch_compute_environment.py +++ b/plugins/modules/aws_batch_compute_environment.py @@ -15,8 +15,8 @@ short_description: Manage AWS Batch Compute Environments description: - This module allows the management of AWS Batch Compute Environments. - It is idempotent and supports "Check" mode. Use module M(aws_batch_compute_environment) to manage the compute - environment, M(aws_batch_job_queue) to manage job queues, M(aws_batch_job_definition) to manage job definitions. + It is idempotent and supports "Check" mode. Use module M(community.aws.aws_batch_compute_environment) to manage the compute + environment, M(community.aws.aws_batch_job_queue) to manage job queues, M(community.aws.aws_batch_job_definition) to manage job definitions. author: Jon Meran (@jonmer85) @@ -134,7 +134,7 @@ state: present tasks: - name: My Batch Compute Environment - aws_batch_compute_environment: + community.aws.aws_batch_compute_environment: compute_environment_name: computeEnvironmentName state: present region: us-east-1 diff --git a/plugins/modules/aws_batch_job_definition.py b/plugins/modules/aws_batch_job_definition.py index 07bcf127295..19e922532a9 100644 --- a/plugins/modules/aws_batch_job_definition.py +++ b/plugins/modules/aws_batch_job_definition.py @@ -15,8 +15,8 @@ short_description: Manage AWS Batch Job Definitions description: - This module allows the management of AWS Batch Job Definitions. - It is idempotent and supports "Check" mode. Use module M(aws_batch_compute_environment) to manage the compute - environment, M(aws_batch_job_queue) to manage job queues, M(aws_batch_job_definition) to manage job definitions. + It is idempotent and supports "Check" mode. Use module M(community.aws.aws_batch_compute_environment) to manage the compute + environment, M(community.aws.aws_batch_job_queue) to manage job queues, M(community.aws.aws_batch_job_definition) to manage job definitions. author: Jon Meran (@jonmer85) @@ -188,7 +188,7 @@ state: present tasks: - name: My Batch Job Definition - aws_batch_job_definition: + community.aws.aws_batch_job_definition: job_definition_name: My Batch Job Definition state: present type: container diff --git a/plugins/modules/aws_batch_job_queue.py b/plugins/modules/aws_batch_job_queue.py index 77726175510..29e369d10b8 100644 --- a/plugins/modules/aws_batch_job_queue.py +++ b/plugins/modules/aws_batch_job_queue.py @@ -15,8 +15,8 @@ short_description: Manage AWS Batch Job Queues description: - This module allows the management of AWS Batch Job Queues. - It is idempotent and supports "Check" mode. Use module M(aws_batch_compute_environment) to manage the compute - environment, M(aws_batch_job_queue) to manage job queues, M(aws_batch_job_definition) to manage job definitions. + It is idempotent and supports "Check" mode. Use module M(community.aws.aws_batch_compute_environment) to manage the compute + environment, M(community.aws.aws_batch_job_queue) to manage job queues, M(community.aws.aws_batch_job_definition) to manage job definitions. author: Jon Meran (@jonmer85) @@ -78,7 +78,7 @@ state: present tasks: - name: My Batch Job Queue - aws_batch_job_queue: + community.aws.aws_batch_job_queue: job_queue_name: jobQueueName state: present region: us-east-1 diff --git a/plugins/modules/aws_codebuild.py b/plugins/modules/aws_codebuild.py index 219289ee2db..1310bd09949 100644 --- a/plugins/modules/aws_codebuild.py +++ b/plugins/modules/aws_codebuild.py @@ -169,7 +169,7 @@ EXAMPLES = ''' # Note: These examples do not set authentication details, see the AWS Guide for details. -- aws_codebuild: +- community.aws.aws_codebuild: name: my_project description: My nice little project service_role: "arn:aws:iam::123123:role/service-role/code-build-service-role" diff --git a/plugins/modules/aws_codecommit.py b/plugins/modules/aws_codecommit.py index f8d7df05d2a..102ba9d4e67 100644 --- a/plugins/modules/aws_codecommit.py +++ b/plugins/modules/aws_codecommit.py @@ -129,12 +129,12 @@ EXAMPLES = ''' # Create a new repository -- aws_codecommit: +- community.aws.aws_codecommit: name: repo state: present # Delete a repository -- aws_codecommit: +- community.aws.aws_codecommit: name: repo state: absent ''' diff --git a/plugins/modules/aws_codepipeline.py b/plugins/modules/aws_codepipeline.py index 84afe1a4dc1..1df9697a9e3 100644 --- a/plugins/modules/aws_codepipeline.py +++ b/plugins/modules/aws_codepipeline.py @@ -86,7 +86,7 @@ # Note: These examples do not set authentication details, see the AWS Guide for details. # Example for creating a pipeline for continuous deploy of Github code to an ECS cluster (container) -- aws_codepipeline: +- community.aws.aws_codepipeline: name: my_deploy_pipeline role_arn: arn:aws:iam::123456:role/AWS-CodePipeline-Service artifact_store: diff --git a/plugins/modules/aws_config_aggregation_authorization.py b/plugins/modules/aws_config_aggregation_authorization.py index 78126794905..ecbbf703876 100644 --- a/plugins/modules/aws_config_aggregation_authorization.py +++ b/plugins/modules/aws_config_aggregation_authorization.py @@ -46,12 +46,12 @@ EXAMPLES = ''' - name: Get current account ID - aws_caller_info: + community.aws.aws_caller_info: register: whoami -- aws_config_aggregation_authorization: +- community.aws.aws_config_aggregation_authorization: state: present authorized_account_id: '{{ whoami.account }}' - authorzed_aws_region: us-east-1 + authorized_aws_region: us-east-1 ''' RETURN = '''#''' diff --git a/plugins/modules/aws_config_aggregator.py b/plugins/modules/aws_config_aggregator.py index 3f39f57cbc9..dc17f0dfb55 100644 --- a/plugins/modules/aws_config_aggregator.py +++ b/plugins/modules/aws_config_aggregator.py @@ -81,7 +81,7 @@ EXAMPLES = ''' - name: Create cross-account aggregator - aws_config_aggregator: + community.aws.aws_config_aggregator: name: test_config_rule state: present account_sources: diff --git a/plugins/modules/aws_config_delivery_channel.py b/plugins/modules/aws_config_delivery_channel.py index 0005d68d462..f4a8093571e 100644 --- a/plugins/modules/aws_config_delivery_channel.py +++ b/plugins/modules/aws_config_delivery_channel.py @@ -59,7 +59,7 @@ EXAMPLES = ''' - name: Create Delivery Channel for AWS Config - aws_config_delivery_channel: + community.aws.aws_config_delivery_channel: name: test_delivery_channel state: present s3_bucket: 'test_aws_config_bucket' diff --git a/plugins/modules/aws_config_recorder.py b/plugins/modules/aws_config_recorder.py index a614748e739..bd6c762e763 100644 --- a/plugins/modules/aws_config_recorder.py +++ b/plugins/modules/aws_config_recorder.py @@ -72,7 +72,7 @@ EXAMPLES = ''' - name: Create Configuration Recorder for AWS Config - aws_config_recorder: + community.aws.aws_config_recorder: name: test_configuration_recorder state: present role_arn: 'arn:aws:iam::123456789012:role/AwsConfigRecorder' diff --git a/plugins/modules/aws_config_rule.py b/plugins/modules/aws_config_rule.py index e2a328ce1d3..53897da8a4d 100644 --- a/plugins/modules/aws_config_rule.py +++ b/plugins/modules/aws_config_rule.py @@ -96,7 +96,7 @@ EXAMPLES = ''' - name: Create Config Rule for AWS Config - aws_config_rule: + community.aws.aws_config_rule: name: test_config_rule state: present description: 'This AWS Config rule checks for public write access on S3 buckets' diff --git a/plugins/modules/aws_direct_connect_connection.py b/plugins/modules/aws_direct_connect_connection.py index 601745de4ff..724b21795c4 100644 --- a/plugins/modules/aws_direct_connect_connection.py +++ b/plugins/modules/aws_direct_connect_connection.py @@ -75,7 +75,7 @@ EXAMPLES = """ # create a Direct Connect connection -- aws_direct_connect_connection: +- community.aws.aws_direct_connect_connection: name: ansible-test-connection state: present location: EqDC2 @@ -84,14 +84,14 @@ register: dc # disassociate the LAG from the connection -- aws_direct_connect_connection: +- community.aws.aws_direct_connect_connection: state: present connection_id: dc.connection.connection_id location: EqDC2 bandwidth: 1Gbps # replace the connection with one with more bandwidth -- aws_direct_connect_connection: +- community.aws.aws_direct_connect_connection: state: present name: ansible-test-connection location: EqDC2 @@ -99,7 +99,7 @@ forced_update: True # delete the connection -- aws_direct_connect_connection: +- community.aws.aws_direct_connect_connection: state: absent name: ansible-test-connection """ diff --git a/plugins/modules/aws_direct_connect_gateway.py b/plugins/modules/aws_direct_connect_gateway.py index d2fc624d747..f095d096565 100644 --- a/plugins/modules/aws_direct_connect_gateway.py +++ b/plugins/modules/aws_direct_connect_gateway.py @@ -60,7 +60,7 @@ EXAMPLES = ''' - name: Create a new direct connect gateway attached to virtual private gateway - dxgw: + community.aws.aws_direct_connect_gateway: state: present name: my-dx-gateway amazon_asn: 7224 @@ -68,7 +68,7 @@ register: created_dxgw - name: Create a new unattached dxgw - dxgw: + community.aws.aws_direct_connect_gateway: state: present name: my-dx-gateway amazon_asn: 7224 diff --git a/plugins/modules/aws_direct_connect_link_aggregation_group.py b/plugins/modules/aws_direct_connect_link_aggregation_group.py index dd7d57dcded..aa2e6106997 100644 --- a/plugins/modules/aws_direct_connect_link_aggregation_group.py +++ b/plugins/modules/aws_direct_connect_link_aggregation_group.py @@ -86,7 +86,7 @@ EXAMPLES = """ # create a Direct Connect connection -- aws_direct_connect_link_aggregation_group: +- community.aws.aws_direct_connect_link_aggregation_group: state: present location: EqDC2 lag_id: dxlag-xxxxxxxx diff --git a/plugins/modules/aws_direct_connect_virtual_interface.py b/plugins/modules/aws_direct_connect_virtual_interface.py index 4a5276631ba..deea6a7852a 100644 --- a/plugins/modules/aws_direct_connect_virtual_interface.py +++ b/plugins/modules/aws_direct_connect_virtual_interface.py @@ -223,14 +223,14 @@ EXAMPLES = ''' --- - name: create an association between a LAG and connection - aws_direct_connect_virtual_interface: + community.aws.aws_direct_connect_virtual_interface: state: present name: "{{ name }}" link_aggregation_group_id: LAG-XXXXXXXX connection_id: dxcon-XXXXXXXX - name: remove an association between a connection and virtual interface - aws_direct_connect_virtual_interface: + community.aws.aws_direct_connect_virtual_interface: state: absent connection_id: dxcon-XXXXXXXX virtual_interface_id: dxv-XXXXXXXX diff --git a/plugins/modules/aws_eks_cluster.py b/plugins/modules/aws_eks_cluster.py index 1b1693be225..04c4f1a9356 100644 --- a/plugins/modules/aws_eks_cluster.py +++ b/plugins/modules/aws_eks_cluster.py @@ -70,7 +70,7 @@ # Note: These examples do not set authentication details, see the AWS Guide for details. - name: Create an EKS cluster - aws_eks_cluster: + community.aws.aws_eks_cluster: name: my_cluster version: 1.14 role_arn: my_eks_role @@ -82,7 +82,7 @@ register: caller_facts - name: Remove an EKS cluster - aws_eks_cluster: + community.aws.aws_eks_cluster: name: my_cluster wait: yes state: absent diff --git a/plugins/modules/aws_elasticbeanstalk_app.py b/plugins/modules/aws_elasticbeanstalk_app.py index c7f45a34e86..08eafd42751 100644 --- a/plugins/modules/aws_elasticbeanstalk_app.py +++ b/plugins/modules/aws_elasticbeanstalk_app.py @@ -52,13 +52,13 @@ EXAMPLES = ''' # Create or update an application -- aws_elasticbeanstalk_app: +- community.aws.aws_elasticbeanstalk_app: app_name: Sample_App description: "Hello World App" state: present # Delete application -- aws_elasticbeanstalk_app: +- community.aws.aws_elasticbeanstalk_app: app_name: Sample_App state: absent diff --git a/plugins/modules/aws_glue_connection.py b/plugins/modules/aws_glue_connection.py index ef1f753abf9..6d71c5f8e0a 100644 --- a/plugins/modules/aws_glue_connection.py +++ b/plugins/modules/aws_glue_connection.py @@ -73,7 +73,7 @@ # Note: These examples do not set authentication details, see the AWS Guide for details. # Create an AWS Glue connection -- aws_glue_connection: +- community.aws.aws_glue_connection: name: my-glue-connection connection_properties: JDBC_CONNECTION_URL: jdbc:mysql://mydb:3306/databasename @@ -82,7 +82,7 @@ state: present # Delete an AWS Glue connection -- aws_glue_connection: +- community.aws.aws_glue_connection: name: my-glue-connection state: absent diff --git a/plugins/modules/aws_glue_job.py b/plugins/modules/aws_glue_job.py index 6fbe23603d8..71b5b57351f 100644 --- a/plugins/modules/aws_glue_job.py +++ b/plugins/modules/aws_glue_job.py @@ -87,14 +87,14 @@ # Note: These examples do not set authentication details, see the AWS Guide for details. # Create an AWS Glue job -- aws_glue_job: +- community.aws.aws_glue_job: command_script_location: s3bucket/script.py name: my-glue-job role: my-iam-role state: present # Delete an AWS Glue job -- aws_glue_job: +- community.aws.aws_glue_job: name: my-glue-job state: absent diff --git a/plugins/modules/aws_inspector_target.py b/plugins/modules/aws_inspector_target.py index 1d33ec00411..6b807c47c41 100644 --- a/plugins/modules/aws_inspector_target.py +++ b/plugins/modules/aws_inspector_target.py @@ -48,20 +48,20 @@ EXAMPLES = ''' - name: Create my_target Assessment Target - aws_inspector_target: + community.aws.aws_inspector_target: name: my_target tags: role: scan_target - name: Update Existing my_target Assessment Target with Additional Tags - aws_inspector_target: + community.aws.aws_inspector_target: name: my_target tags: env: dev role: scan_target - name: Delete my_target Assessment Target - aws_inspector_target: + community.aws.aws_inspector_target: name: my_target state: absent ''' diff --git a/plugins/modules/aws_kms.py b/plugins/modules/aws_kms.py index 879676286d3..7cb12413f44 100644 --- a/plugins/modules/aws_kms.py +++ b/plugins/modules/aws_kms.py @@ -21,7 +21,7 @@ description: An alias for a key. For safety, even though KMS does not require keys to have an alias, this module expects all new keys to be given an alias to make them easier to manage. Existing keys without an alias may be - referred to by I(key_id). Use M(aws_kms_info) to find key ids. Required + referred to by I(key_id). Use M(community.aws.aws_kms_info) to find key ids. Required if I(key_id) is not given. Note that passing a I(key_id) and I(alias) will only cause a new alias to be added, an alias will never be renamed. The 'alias/' prefix is optional. @@ -181,28 +181,28 @@ # Managing the KMS IAM Policy via policy_mode and policy_grant_types is fragile # and has been deprecated in favour of the policy option. - name: grant user-style access to production secrets - aws_kms: + community.aws.aws_kms: args: alias: "alias/my_production_secrets" policy_mode: grant policy_role_name: "prod-appServerRole-1R5AQG2BSEL6L" policy_grant_types: "role,role grant" - name: remove access to production secrets from role - aws_kms: + community.aws.aws_kms: args: alias: "alias/my_production_secrets" policy_mode: deny policy_role_name: "prod-appServerRole-1R5AQG2BSEL6L" # Create a new KMS key -- aws_kms: +- community.aws.aws_kms: alias: mykey tags: Name: myKey Purpose: protect_stuff # Update previous key with more tags -- aws_kms: +- community.aws.aws_kms: alias: mykey tags: Name: myKey @@ -212,7 +212,7 @@ # Update a known key with grants allowing an instance with the billing-prod IAM profile # to decrypt data encrypted with the environment: production, application: billing # encryption context -- aws_kms: +- community.aws.aws_kms: key_id: abcd1234-abcd-1234-5678-ef1234567890 grants: - name: billing_prod @@ -226,13 +226,13 @@ - RetireGrant - name: Update IAM policy on an existing KMS key - aws_kms: + community.aws.aws_kms: alias: my-kms-key policy: '{"Version": "2012-10-17", "Id": "my-kms-key-permissions", "Statement": [ { } ]}' state: present - name: Example using lookup for policy json - aws_kms: + community.aws.aws_kms: alias: my-kms-key policy: "{{ lookup('template', 'kms_iam_policy_template.json.j2') }}" state: present diff --git a/plugins/modules/aws_kms_info.py b/plugins/modules/aws_kms_info.py index c615d3a293f..445dff6bbae 100644 --- a/plugins/modules/aws_kms_info.py +++ b/plugins/modules/aws_kms_info.py @@ -40,15 +40,15 @@ # Note: These examples do not set authentication details, see the AWS Guide for details. # Gather information about all KMS keys -- aws_kms_info: +- community.aws.aws_kms_info: # Gather information about all keys with a Name tag -- aws_kms_info: +- community.aws.aws_kms_info: filters: tag-key: Name # Gather information about all keys with a specific name -- aws_kms_info: +- community.aws.aws_kms_info: filters: "tag:Name": Example ''' diff --git a/plugins/modules/aws_region_info.py b/plugins/modules/aws_region_info.py index dee88d852ba..b09e7953450 100644 --- a/plugins/modules/aws_region_info.py +++ b/plugins/modules/aws_region_info.py @@ -38,10 +38,10 @@ # Note: These examples do not set authentication details, see the AWS Guide for details. # Gather information about all regions -- aws_region_info: +- community.aws.aws_region_info: # Gather information about a single region -- aws_region_info: +- community.aws.aws_region_info: filters: region-name: eu-west-1 ''' diff --git a/plugins/modules/aws_s3_bucket_info.py b/plugins/modules/aws_s3_bucket_info.py index a69ae8a8b99..0d6049f7a98 100644 --- a/plugins/modules/aws_s3_bucket_info.py +++ b/plugins/modules/aws_s3_bucket_info.py @@ -20,7 +20,7 @@ description: - Lists S3 buckets in AWS - This module was called C(aws_s3_bucket_facts) before Ansible 2.9, returning C(ansible_facts). - Note that the M(aws_s3_bucket_info) module no longer returns C(ansible_facts)! + Note that the M(community.aws.aws_s3_bucket_info) module no longer returns C(ansible_facts)! author: "Gerben Geijteman (@hyperized)" extends_documentation_fragment: - amazon.aws.aws @@ -34,7 +34,7 @@ # Note: Only AWS S3 is currently supported # Lists all s3 buckets -- aws_s3_bucket_info: +- community.aws.aws_s3_bucket_info: register: result - name: List buckets diff --git a/plugins/modules/aws_s3_cors.py b/plugins/modules/aws_s3_cors.py index 272b177e6cf..2ee57223c9d 100644 --- a/plugins/modules/aws_s3_cors.py +++ b/plugins/modules/aws_s3_cors.py @@ -43,7 +43,7 @@ # Note: These examples do not set authentication details, see the AWS Guide for details. # Create a simple cors for s3 bucket -- aws_s3_cors: +- community.aws.aws_s3_cors: name: mys3bucket state: present rules: @@ -60,7 +60,7 @@ max_age_seconds: 30000 # Remove cors for s3 bucket -- aws_s3_cors: +- community.aws.aws_s3_cors: name: mys3bucket state: absent ''' diff --git a/plugins/modules/aws_secret.py b/plugins/modules/aws_secret.py index afcb2976c3b..a61581a1b2f 100644 --- a/plugins/modules/aws_secret.py +++ b/plugins/modules/aws_secret.py @@ -80,14 +80,14 @@ EXAMPLES = r''' - name: Add string to AWS Secrets Manager - aws_secret: + community.aws.aws_secret: name: 'test_secret_string' state: present secret_type: 'string' secret: "{{ super_secret_string }}" - name: remove string from AWS Secrets Manager - aws_secret: + community.aws.aws_secret: name: 'test_secret_string' state: absent secret_type: 'string' diff --git a/plugins/modules/aws_ses_identity.py b/plugins/modules/aws_ses_identity.py index ccc40344fe4..afd24b0650c 100644 --- a/plugins/modules/aws_ses_identity.py +++ b/plugins/modules/aws_ses_identity.py @@ -100,31 +100,31 @@ # Note: These examples do not set authentication details, see the AWS Guide for details. - name: Ensure example@example.com email identity exists - aws_ses_identity: + community.aws.aws_ses_identity: identity: example@example.com state: present - name: Delete example@example.com email identity - aws_ses_identity: + community.aws.aws_ses_identity: email: example@example.com state: absent - name: Ensure example.com domain identity exists - aws_ses_identity: + community.aws.aws_ses_identity: identity: example.com state: present # Create an SNS topic and send bounce and complaint notifications to it # instead of emailing the identity owner - name: Ensure complaints-topic exists - sns_topic: + community.aws.sns_topic: name: "complaints-topic" state: present purge_subscriptions: False register: topic_info - name: Deliver feedback to topic instead of owner email - aws_ses_identity: + community.aws.aws_ses_identity: identity: example@example.com state: present complaint_notifications: @@ -138,14 +138,14 @@ # Create an SNS topic for delivery notifications and leave complaints # Being forwarded to the identity owner email - name: Ensure delivery-notifications-topic exists - sns_topic: + community.aws.sns_topic: name: "delivery-notifications-topic" state: present purge_subscriptions: False register: topic_info - name: Delivery notifications to topic - aws_ses_identity: + community.aws.aws_ses_identity: identity: example@example.com state: present delivery_notifications: diff --git a/plugins/modules/aws_ses_identity_policy.py b/plugins/modules/aws_ses_identity_policy.py index 5bbf91343b8..c59c15213ca 100644 --- a/plugins/modules/aws_ses_identity_policy.py +++ b/plugins/modules/aws_ses_identity_policy.py @@ -51,28 +51,28 @@ # Note: These examples do not set authentication details, see the AWS Guide for details. - name: add sending authorization policy to domain identity - aws_ses_identity_policy: + community.aws.aws_ses_identity_policy: identity: example.com policy_name: ExamplePolicy policy: "{{ lookup('template', 'policy.json.j2') }}" state: present - name: add sending authorization policy to email identity - aws_ses_identity_policy: + community.aws.aws_ses_identity_policy: identity: example@example.com policy_name: ExamplePolicy policy: "{{ lookup('template', 'policy.json.j2') }}" state: present - name: add sending authorization policy to identity using ARN - aws_ses_identity_policy: + community.aws.aws_ses_identity_policy: identity: "arn:aws:ses:us-east-1:12345678:identity/example.com" policy_name: ExamplePolicy policy: "{{ lookup('template', 'policy.json.j2') }}" state: present - name: remove sending authorization policy - aws_ses_identity_policy: + community.aws.aws_ses_identity_policy: identity: example.com policy_name: ExamplePolicy state: absent diff --git a/plugins/modules/aws_ses_rule_set.py b/plugins/modules/aws_ses_rule_set.py index b5e78d1b419..4a2c8116ba9 100644 --- a/plugins/modules/aws_ses_rule_set.py +++ b/plugins/modules/aws_ses_rule_set.py @@ -15,7 +15,7 @@ module: aws_ses_rule_set short_description: Manages SES inbound receipt rule sets description: - - The M(aws_ses_rule_set) module allows you to create, delete, and manage SES receipt rule sets + - The M(community.aws.aws_ses_rule_set) module allows you to create, delete, and manage SES receipt rule sets author: - "Ben Tomasik (@tomislacker)" - "Ed Costello (@orthanc)" @@ -58,29 +58,29 @@ # It is assumed that their matching environment variables are set. --- - name: Create default rule set and activate it if not already - aws_ses_rule_set: + community.aws.aws_ses_rule_set: name: default-rule-set state: present active: yes - name: Create some arbitrary rule set but do not activate it - aws_ses_rule_set: + community.aws.aws_ses_rule_set: name: arbitrary-rule-set state: present - name: Explicitly deactivate the default rule set leaving no active rule set - aws_ses_rule_set: + community.aws.aws_ses_rule_set: name: default-rule-set state: present active: no - name: Remove an arbitrary inactive rule set - aws_ses_rule_set: + community.aws.aws_ses_rule_set: name: arbitrary-rule-set state: absent - name: Remove an ruleset even if we have to first deactivate it to remove it - aws_ses_rule_set: + community.aws.aws_ses_rule_set: name: default-rule-set state: absent force: yes diff --git a/plugins/modules/aws_sgw_info.py b/plugins/modules/aws_sgw_info.py index b1ac00ef70c..0716545a9d3 100644 --- a/plugins/modules/aws_sgw_info.py +++ b/plugins/modules/aws_sgw_info.py @@ -168,10 +168,10 @@ # Note: These examples do not set authentication details, see the AWS Guide for details. - name: "Get AWS storage gateway information" - aws_sgw_info: + community.aws.aws_sgw_info: - name: "Get AWS storage gateway information for region eu-west-3" - aws_sgw_info: + community.aws.aws_sgw_info: region: eu-west-3 ''' diff --git a/plugins/modules/aws_ssm_parameter_store.py b/plugins/modules/aws_ssm_parameter_store.py index 9e0683d1c85..62cdde0cf64 100644 --- a/plugins/modules/aws_ssm_parameter_store.py +++ b/plugins/modules/aws_ssm_parameter_store.py @@ -80,25 +80,25 @@ EXAMPLES = ''' - name: Create or update key/value pair in aws parameter store - aws_ssm_parameter_store: + community.aws.aws_ssm_parameter_store: name: "Hello" description: "This is your first key" value: "World" - name: Delete the key - aws_ssm_parameter_store: + community.aws.aws_ssm_parameter_store: name: "Hello" state: absent - name: Create or update secure key/value pair with default kms key (aws/ssm) - aws_ssm_parameter_store: + community.aws.aws_ssm_parameter_store: name: "Hello" description: "This is your first key" string_type: "SecureString" value: "World" - name: Create or update secure key/value pair with nominated kms key - aws_ssm_parameter_store: + community.aws.aws_ssm_parameter_store: name: "Hello" description: "This is your first key" string_type: "SecureString" @@ -106,7 +106,7 @@ value: "World" - name: Always update a parameter store value and create a new version - aws_ssm_parameter_store: + community.aws.aws_ssm_parameter_store: name: "overwrite_example" description: "This example will always overwrite the value" string_type: "String" @@ -114,7 +114,8 @@ overwrite_value: "always" - name: recommend to use with aws_ssm lookup plugin - debug: msg="{{ lookup('aws_ssm', 'hello') }}" + debug: + msg: "{{ lookup('amazon.aws.aws_ssm', 'hello') }}" ''' RETURN = ''' diff --git a/plugins/modules/aws_step_functions_state_machine.py b/plugins/modules/aws_step_functions_state_machine.py index 9a9bdf365a4..5ea0545a79c 100644 --- a/plugins/modules/aws_step_functions_state_machine.py +++ b/plugins/modules/aws_step_functions_state_machine.py @@ -71,7 +71,7 @@ EXAMPLES = ''' # Create a new AWS Step Functions state machine - name: Setup HelloWorld state machine - aws_step_functions_state_machine: + community.aws.aws_step_functions_state_machine: name: "HelloWorldStateMachine" definition: "{{ lookup('file','state_machine.json') }}" role_arn: arn:aws:iam::987654321012:role/service-role/invokeLambdaStepFunctionsRole @@ -80,7 +80,7 @@ # Update an existing state machine - name: Change IAM Role and tags of HelloWorld state machine - aws_step_functions_state_machine: + community.aws.aws_step_functions_state_machine: name: HelloWorldStateMachine definition: "{{ lookup('file','state_machine.json') }}" role_arn: arn:aws:iam::987654321012:role/service-role/anotherStepFunctionsRole @@ -89,7 +89,7 @@ # Remove the AWS Step Functions state machine - name: Delete HelloWorld state machine - aws_step_functions_state_machine: + community.aws.aws_step_functions_state_machine: name: HelloWorldStateMachine state: absent ''' diff --git a/plugins/modules/aws_step_functions_state_machine_execution.py b/plugins/modules/aws_step_functions_state_machine_execution.py index d4c2b7324d4..0719195833e 100644 --- a/plugins/modules/aws_step_functions_state_machine_execution.py +++ b/plugins/modules/aws_step_functions_state_machine_execution.py @@ -61,13 +61,13 @@ EXAMPLES = ''' - name: Start an execution of a state machine - aws_step_functions_state_machine_execution: + community.aws.aws_step_functions_state_machine_execution: name: an_execution_name execution_input: '{ "IsHelloWorldExample": true }' state_machine_arn: "arn:aws:states:us-west-2:682285639423:stateMachine:HelloWorldStateMachine" - name: Stop an execution of a state machine - aws_step_functions_state_machine_execution: + community.aws.aws_step_functions_state_machine_execution: action: stop execution_arn: "arn:aws:states:us-west-2:682285639423:execution:HelloWorldStateMachineCopy:a1e8e2b5-5dfe-d40e-d9e3-6201061047c8" cause: "cause of task failure" diff --git a/plugins/modules/aws_waf_condition.py b/plugins/modules/aws_waf_condition.py index c9184103cb7..a7cd2bcf592 100644 --- a/plugins/modules/aws_waf_condition.py +++ b/plugins/modules/aws_waf_condition.py @@ -141,7 +141,7 @@ EXAMPLES = ''' - name: create WAF byte condition - aws_waf_condition: + community.aws.aws_waf_condition: name: my_byte_condition filters: - field_to_match: header @@ -151,7 +151,7 @@ type: byte - name: create WAF geo condition - aws_waf_condition: + community.aws.aws_waf_condition: name: my_geo_condition filters: - country: US @@ -160,7 +160,7 @@ type: geo - name: create IP address condition - aws_waf_condition: + community.aws.aws_waf_condition: name: "{{ resource_prefix }}_ip_condition" filters: - ip_address: "10.0.0.0/8" @@ -168,7 +168,7 @@ type: ip - name: create WAF regex condition - aws_waf_condition: + community.aws.aws_waf_condition: name: my_regex_condition filters: - field_to_match: query_string @@ -181,7 +181,7 @@ type: regex - name: create WAF size condition - aws_waf_condition: + community.aws.aws_waf_condition: name: my_size_condition filters: - field_to_match: query_string @@ -190,7 +190,7 @@ type: size - name: create WAF sql injection condition - aws_waf_condition: + community.aws.aws_waf_condition: name: my_sql_condition filters: - field_to_match: query_string @@ -198,7 +198,7 @@ type: sql - name: create WAF xss condition - aws_waf_condition: + community.aws.aws_waf_condition: name: my_xss_condition filters: - field_to_match: query_string diff --git a/plugins/modules/aws_waf_info.py b/plugins/modules/aws_waf_info.py index 8b3b6e87da7..50cd38504c9 100644 --- a/plugins/modules/aws_waf_info.py +++ b/plugins/modules/aws_waf_info.py @@ -38,14 +38,14 @@ EXAMPLES = ''' - name: obtain all WAF information - aws_waf_info: + community.aws.aws_waf_info: - name: obtain all information for a single WAF - aws_waf_info: + community.aws.aws_waf_info: name: test_waf - name: obtain all information for a single WAF Regional - aws_waf_info: + community.aws.aws_waf_info: name: test_waf waf_regional: true ''' diff --git a/plugins/modules/aws_waf_rule.py b/plugins/modules/aws_waf_rule.py index 95dc831acbf..f8b56ebacb3 100644 --- a/plugins/modules/aws_waf_rule.py +++ b/plugins/modules/aws_waf_rule.py @@ -45,7 +45,7 @@ type: str conditions: description: > - List of conditions used in the rule. M(aws_waf_condition) can be used to + List of conditions used in the rule. M(community.aws.aws_waf_condition) can be used to create new conditions. type: list elements: dict @@ -78,7 +78,7 @@ EXAMPLES = ''' - name: create WAF rule - aws_waf_rule: + community.aws.aws_waf_rule: name: my_waf_rule conditions: - name: my_regex_condition @@ -92,7 +92,7 @@ negated: yes - name: remove WAF rule - aws_waf_rule: + community.aws.aws_waf_rule: name: "my_waf_rule" state: absent diff --git a/plugins/modules/aws_waf_web_acl.py b/plugins/modules/aws_waf_web_acl.py index a942a4cb77a..96b2d3cdf0e 100644 --- a/plugins/modules/aws_waf_web_acl.py +++ b/plugins/modules/aws_waf_web_acl.py @@ -88,7 +88,7 @@ EXAMPLES = ''' - name: create web ACL - aws_waf_web_acl: + community.aws.aws_waf_web_acl: name: my_web_acl rules: - name: my_rule @@ -99,7 +99,7 @@ state: present - name: delete the web acl - aws_waf_web_acl: + community.aws.aws_waf_web_acl: name: my_web_acl state: absent ''' diff --git a/plugins/modules/cloudformation_exports_info.py b/plugins/modules/cloudformation_exports_info.py index e254d1deafa..2a46c50606f 100644 --- a/plugins/modules/cloudformation_exports_info.py +++ b/plugins/modules/cloudformation_exports_info.py @@ -25,7 +25,7 @@ EXAMPLES = ''' - name: Get Exports - cloudformation_exports_info: + community.aws.cloudformation_exports_info: profile: 'my_aws_profile' region: 'my_region' register: cf_exports diff --git a/plugins/modules/cloudformation_stack_set.py b/plugins/modules/cloudformation_stack_set.py index 6d20469c764..d085776da9b 100644 --- a/plugins/modules/cloudformation_stack_set.py +++ b/plugins/modules/cloudformation_stack_set.py @@ -17,7 +17,7 @@ description: - Launches/updates/deletes AWS CloudFormation Stack Sets. notes: - - To make an individual stack, you want the M(cloudformation) module. + - To make an individual stack, you want the M(amazon.aws.cloudformation) module. options: name: description: @@ -181,7 +181,7 @@ EXAMPLES = ''' - name: Create a stack set with instances in two accounts - cloudformation_stack_set: + community.aws.cloudformation_stack_set: name: my-stack description: Test stack in two accounts state: present @@ -191,7 +191,7 @@ - us-east-1 - name: on subsequent calls, templates are optional but parameters and tags can be altered - cloudformation_stack_set: + community.aws.cloudformation_stack_set: name: my-stack state: present parameters: @@ -204,7 +204,7 @@ - us-east-1 - name: The same type of update, but wait for the update to complete in all stacks - cloudformation_stack_set: + community.aws.cloudformation_stack_set: name: my-stack state: present wait: true diff --git a/plugins/modules/cloudfront_distribution.py b/plugins/modules/cloudfront_distribution.py index 1b7a8f07eab..0193935f7a6 100644 --- a/plugins/modules/cloudfront_distribution.py +++ b/plugins/modules/cloudfront_distribution.py @@ -585,10 +585,8 @@ ''' EXAMPLES = ''' - -# create a basic distribution with defaults and tags - -- cloudfront_distribution: +- name: create a basic distribution with defaults and tags + community.aws.cloudfront_distribution: state: present default_origin_domain_name: www.my-cloudfront-origin.com tags: @@ -596,31 +594,27 @@ Project: example project Priority: '1' -# update a distribution comment by distribution_id - -- cloudfront_distribution: +- name: update a distribution comment by distribution_id + community.aws.cloudfront_distribution: state: present distribution_id: E1RP5A2MJ8073O comment: modified by ansible cloudfront.py -# update a distribution comment by caller_reference - -- cloudfront_distribution: +- name: update a distribution comment by caller_reference + community.aws.cloudfront_distribution: state: present caller_reference: my cloudfront distribution 001 comment: modified by ansible cloudfront.py -# update a distribution's aliases and comment using the distribution_id as a reference - -- cloudfront_distribution: +- name: update a distribution's aliases and comment using the distribution_id as a reference + community.aws.cloudfront_distribution: state: present distribution_id: E1RP5A2MJ8073O comment: modified by cloudfront.py again aliases: [ 'www.my-distribution-source.com', 'zzz.aaa.io' ] -# update a distribution's aliases and comment using an alias as a reference - -- cloudfront_distribution: +- name: update a distribution's aliases and comment using an alias as a reference + community.aws.cloudfront_distribution: state: present caller_reference: my test distribution comment: modified by cloudfront.py again @@ -628,9 +622,8 @@ - www.my-distribution-source.com - zzz.aaa.io -# update a distribution's comment and aliases and tags and remove existing tags - -- cloudfront_distribution: +- name:update a distribution's comment and aliases and tags and remove existing tags + community.aws.cloudfront_distribution: state: present distribution_id: E15BU8SDCGSG57 comment: modified by cloudfront.py again @@ -640,9 +633,8 @@ Project: distribution 1.2 purge_tags: yes -# create a distribution with an origin, logging and default cache behavior - -- cloudfront_distribution: +- name: create a distribution with an origin, logging and default cache behavior + community.aws.cloudfront_distribution: state: present caller_reference: unique test distribution ID origins: @@ -678,9 +670,8 @@ enabled: false comment: this is a CloudFront distribution with logging -# delete a distribution - -- cloudfront_distribution: +- name: delete a distribution + community.aws.cloudfront_distribution: state: absent caller_reference: replaceable distribution ''' diff --git a/plugins/modules/cloudfront_info.py b/plugins/modules/cloudfront_info.py index 71f584b852a..6fb6bca66f5 100644 --- a/plugins/modules/cloudfront_info.py +++ b/plugins/modules/cloudfront_info.py @@ -18,7 +18,7 @@ description: - Gets information about an AWS CloudFront distribution. - This module was called C(cloudfront_facts) before Ansible 2.9, returning C(ansible_facts). - Note that the M(cloudfront_info) module no longer returns C(ansible_facts)! + Note that the M(community.aws.cloudfront_info) module no longer returns C(ansible_facts)! requirements: - boto3 >= 1.0.0 - python >= 2.6 @@ -157,21 +157,21 @@ EXAMPLES = ''' # Note: These examples do not set authentication details, see the AWS Guide for details. -# Get a summary of distributions -- cloudfront_info: +- name: Get a summary of distributions + community.aws.cloudfront_info: summary: true register: result -# Get information about a distribution -- cloudfront_info: +- name: Get information about a distribution + community.aws.cloudfront_info: distribution: true distribution_id: my-cloudfront-distribution-id register: result_did - debug: msg: "{{ result_did['cloudfront']['my-cloudfront-distribution-id'] }}" -# Get information about a distribution using the CNAME of the cloudfront distribution. -- cloudfront_info: +- name: Get information about a distribution using the CNAME of the cloudfront distribution. + community.aws.cloudfront_info: distribution: true domain_name_alias: www.my-website.com register: result_website @@ -181,36 +181,37 @@ # When the module is called as cloudfront_facts, return values are published # in ansible_facts['cloudfront'][] and can be used as follows. # Note that this is deprecated and will stop working in Ansible 2.13. -- cloudfront_facts: +- name: Gather facts + community.aws.cloudfront_facts: distribution: true distribution_id: my-cloudfront-distribution-id - debug: msg: "{{ ansible_facts['cloudfront']['my-cloudfront-distribution-id'] }}" -- cloudfront_facts: +- community.aws.cloudfront_facts: distribution: true domain_name_alias: www.my-website.com - debug: msg: "{{ ansible_facts['cloudfront']['www.my-website.com'] }}" -# Get all information about an invalidation for a distribution. -- cloudfront_facts: +- name: Get all information about an invalidation for a distribution. + community.aws.cloudfront_info: invalidation: true distribution_id: my-cloudfront-distribution-id invalidation_id: my-cloudfront-invalidation-id -# Get all information about a CloudFront origin access identity. -- cloudfront_facts: +- name: Get all information about a CloudFront origin access identity. + community.aws.cloudfront_info: origin_access_identity: true origin_access_identity_id: my-cloudfront-origin-access-identity-id -# Get all information about lists not requiring parameters (ie. list_origin_access_identities, list_distributions, list_streaming_distributions) -- cloudfront_facts: +- name: Get all information about lists not requiring parameters (ie. list_origin_access_identities, list_distributions, list_streaming_distributions) + community.aws.cloudfront_info: origin_access_identity: true origin_access_identity_id: my-cloudfront-origin-access-identity-id -# Get all information about lists not requiring parameters (ie. list_origin_access_identities, list_distributions, list_streaming_distributions) -- cloudfront_facts: +- name: Get all information about lists not requiring parameters (ie. list_origin_access_identities, list_distributions, list_streaming_distributions) + community.aws.cloudfront_info: all_lists: true ''' diff --git a/plugins/modules/cloudfront_invalidation.py b/plugins/modules/cloudfront_invalidation.py index 1cf6f3dfa7e..c1f76a84078 100644 --- a/plugins/modules/cloudfront_invalidation.py +++ b/plugins/modules/cloudfront_invalidation.py @@ -63,7 +63,7 @@ EXAMPLES = ''' - name: create a batch of invalidations using a distribution_id for a reference - cloudfront_invalidation: + community.aws.cloudfront_invalidation: distribution_id: E15BU8SDCGSG57 caller_reference: testing 123 target_paths: @@ -72,7 +72,7 @@ - /testpaththree/test3.ss - name: create a batch of invalidations using an alias as a reference and one path using a wildcard match - cloudfront_invalidation: + community.aws.cloudfront_invalidation: alias: alias.test.com caller_reference: testing 123 target_paths: diff --git a/plugins/modules/cloudfront_origin_access_identity.py b/plugins/modules/cloudfront_origin_access_identity.py index 9e788fdc21f..5db2257cb35 100644 --- a/plugins/modules/cloudfront_origin_access_identity.py +++ b/plugins/modules/cloudfront_origin_access_identity.py @@ -65,19 +65,19 @@ EXAMPLES = ''' - name: create an origin access identity - cloudfront_origin_access_identity: + community.aws.cloudfront_origin_access_identity: state: present caller_reference: this is an example reference comment: this is an example comment - name: update an existing origin access identity using caller_reference as an identifier - cloudfront_origin_access_identity: + community.aws.cloudfront_origin_access_identity: origin_access_identity_id: E17DRN9XUOAHZX caller_reference: this is an example reference comment: this is a new comment - name: delete an existing origin access identity using caller_reference as an identifier - cloudfront_origin_access_identity: + community.aws.cloudfront_origin_access_identity: state: absent caller_reference: this is an example reference comment: this is a new comment diff --git a/plugins/modules/cloudtrail.py b/plugins/modules/cloudtrail.py index 5fb0858d9ab..8a669281680 100644 --- a/plugins/modules/cloudtrail.py +++ b/plugins/modules/cloudtrail.py @@ -110,7 +110,7 @@ EXAMPLES = ''' - name: create single region cloudtrail - cloudtrail: + community.aws.cloudtrail: state: present name: default s3_bucket_name: mylogbucket @@ -118,7 +118,7 @@ region: us-east-1 - name: create multi-region trail with validation and tags - cloudtrail: + community.aws.cloudtrail: state: present name: default s3_bucket_name: mylogbucket @@ -133,7 +133,7 @@ Name: default - name: show another valid kms_key_id - cloudtrail: + community.aws.cloudtrail: state: present name: default s3_bucket_name: mylogbucket @@ -141,7 +141,7 @@ # simply "12345678-1234-1234-1234-123456789012" would be valid too. - name: pause logging the trail we just created - cloudtrail: + community.aws.cloudtrail: state: present name: default enable_logging: false @@ -154,7 +154,7 @@ Name: default - name: delete a trail - cloudtrail: + community.aws.cloudtrail: state: absent name: default ''' diff --git a/plugins/modules/cloudwatchevent_rule.py b/plugins/modules/cloudwatchevent_rule.py index 8167ac6a3de..c5e0dc4fa30 100644 --- a/plugins/modules/cloudwatchevent_rule.py +++ b/plugins/modules/cloudwatchevent_rule.py @@ -112,7 +112,7 @@ ''' EXAMPLES = ''' -- cloudwatchevent_rule: +- community.aws.cloudwatchevent_rule: name: MyCronTask schedule_expression: "cron(0 20 * * ? *)" description: Run my scheduled task @@ -120,7 +120,7 @@ - id: MyTargetId arn: arn:aws:lambda:us-east-1:123456789012:function:MyFunction -- cloudwatchevent_rule: +- community.aws.cloudwatchevent_rule: name: MyDisabledCronTask schedule_expression: "rate(5 minutes)" description: Run my disabled scheduled task @@ -130,7 +130,7 @@ arn: arn:aws:lambda:us-east-1:123456789012:function:MyFunction input: '{"foo": "bar"}' -- cloudwatchevent_rule: +- community.aws.cloudwatchevent_rule: name: MyCronTask state: absent ''' diff --git a/plugins/modules/cloudwatchlogs_log_group.py b/plugins/modules/cloudwatchlogs_log_group.py index af883b32d15..f9e1a066e95 100644 --- a/plugins/modules/cloudwatchlogs_log_group.py +++ b/plugins/modules/cloudwatchlogs_log_group.py @@ -75,21 +75,21 @@ EXAMPLES = ''' # Note: These examples do not set authentication details, see the AWS Guide for details. -- cloudwatchlogs_log_group: +- community.aws.cloudwatchlogs_log_group: log_group_name: test-log-group -- cloudwatchlogs_log_group: +- community.aws.cloudwatchlogs_log_group: state: present log_group_name: test-log-group tags: { "Name": "test-log-group", "Env" : "QA" } -- cloudwatchlogs_log_group: +- community.aws.cloudwatchlogs_log_group: state: present log_group_name: test-log-group tags: { "Name": "test-log-group", "Env" : "QA" } kms_key_id: arn:aws:kms:region:account-id:key/key-id -- cloudwatchlogs_log_group: +- community.aws.cloudwatchlogs_log_group: state: absent log_group_name: test-log-group diff --git a/plugins/modules/cloudwatchlogs_log_group_info.py b/plugins/modules/cloudwatchlogs_log_group_info.py index 4bbc25534d2..9fcad357670 100644 --- a/plugins/modules/cloudwatchlogs_log_group_info.py +++ b/plugins/modules/cloudwatchlogs_log_group_info.py @@ -33,7 +33,7 @@ EXAMPLES = ''' # Note: These examples do not set authentication details, see the AWS Guide for details. -- cloudwatchlogs_log_group_info: +- community.aws.cloudwatchlogs_log_group_info: log_group_name: test-log-group ''' diff --git a/plugins/modules/cloudwatchlogs_log_group_metric_filter.py b/plugins/modules/cloudwatchlogs_log_group_metric_filter.py index 52f7f3c9306..860e67b2b70 100644 --- a/plugins/modules/cloudwatchlogs_log_group_metric_filter.py +++ b/plugins/modules/cloudwatchlogs_log_group_metric_filter.py @@ -16,7 +16,7 @@ short_description: Manage CloudWatch log group metric filter description: - Create, modify and delete CloudWatch log group metric filter. - - CloudWatch log group metric filter can be use with M(ec2_metric_alarm). + - CloudWatch log group metric filter can be use with M(community.aws.ec2_metric_alarm). requirements: - boto3 - botocore @@ -70,7 +70,7 @@ EXAMPLES = ''' - name: set metric filter on log group /fluentd/testcase - cloudwatchlogs_log_group_metric_filter: + community.aws.cloudwatchlogs_log_group_metric_filter: log_group_name: /fluentd/testcase filter_name: BoxFreeStorage filter_pattern: '{($.value = *) && ($.hostname = "box")}' @@ -81,7 +81,7 @@ metric_value: "$.value" - name: delete metric filter on log group /fluentd/testcase - cloudwatchlogs_log_group_metric_filter: + community.aws.cloudwatchlogs_log_group_metric_filter: log_group_name: /fluentd/testcase filter_name: BoxFreeStorage state: absent diff --git a/plugins/modules/data_pipeline.py b/plugins/modules/data_pipeline.py index 5637c590ed4..6823eb039ea 100644 --- a/plugins/modules/data_pipeline.py +++ b/plugins/modules/data_pipeline.py @@ -136,7 +136,7 @@ # Note: These examples do not set authentication details, see the AWS Guide for details. # Create pipeline -- data_pipeline: +- community.aws.data_pipeline: name: test-dp region: us-west-2 objects: "{{pipelineObjects}}" @@ -148,7 +148,7 @@ state: present # Example populating and activating a pipeline that demonstrates two ways of providing pipeline objects -- data_pipeline: +- community.aws.data_pipeline: name: test-dp objects: - "id": "DefaultSchedule" @@ -171,13 +171,13 @@ state: active # Activate pipeline -- data_pipeline: +- community.aws.data_pipeline: name: test-dp region: us-west-2 state: active # Delete pipeline -- data_pipeline: +- community.aws.data_pipeline: name: test-dp region: us-west-2 state: absent diff --git a/plugins/modules/dms_endpoint.py b/plugins/modules/dms_endpoint.py index aac3f2aeab4..064970687bc 100644 --- a/plugins/modules/dms_endpoint.py +++ b/plugins/modules/dms_endpoint.py @@ -154,8 +154,8 @@ EXAMPLES = ''' # Note: These examples do not set authentication details -# Endpoint Creation -- dms_endpoint: +- name: Endpoint Creation + community.aws.dms_endpoint: state: absent endpointidentifier: 'testsource' endpointtype: source @@ -170,7 +170,7 @@ ''' RETURN = ''' # ''' -__metaclass__ = type + import traceback from ansible_collections.amazon.aws.plugins.module_utils.aws.core import AnsibleAWSModule from ansible_collections.amazon.aws.plugins.module_utils.ec2 import camel_dict_to_snake_dict, AWSRetry diff --git a/plugins/modules/dms_replication_subnet_group.py b/plugins/modules/dms_replication_subnet_group.py index 3dfc121d3af..9dd4f15fba7 100644 --- a/plugins/modules/dms_replication_subnet_group.py +++ b/plugins/modules/dms_replication_subnet_group.py @@ -53,7 +53,7 @@ ''' EXAMPLES = ''' -- dms_replication_subnet_group: +- community.aws.dms_replication_subnet_group: state: present identifier: "dev-sngroup" description: "Development Subnet Group asdasdas" diff --git a/plugins/modules/dynamodb_table.py b/plugins/modules/dynamodb_table.py index 47a65123a84..fcb8e56c45c 100644 --- a/plugins/modules/dynamodb_table.py +++ b/plugins/modules/dynamodb_table.py @@ -126,8 +126,8 @@ ''' EXAMPLES = ''' -# Create dynamo table with hash and range primary key -- dynamodb_table: +- name: Create dynamo table with hash and range primary key + community.aws.dynamodb_table: name: my-table region: us-east-1 hash_key_name: id @@ -139,15 +139,15 @@ tags: tag_name: tag_value -# Update capacity on existing dynamo table -- dynamodb_table: +- name: Update capacity on existing dynamo table + community.aws.dynamodb_table: name: my-table region: us-east-1 read_capacity: 10 write_capacity: 10 -# set index on existing dynamo table -- dynamodb_table: +- name: set index on existing dynamo table + community.aws.dynamodb_table: name: my-table region: us-east-1 indexes: @@ -161,8 +161,8 @@ read_capacity: 10 write_capacity: 10 -# Delete dynamo table -- dynamodb_table: +- name: Delete dynamo table + community.aws.dynamodb_table: name: my-table region: us-east-1 state: absent diff --git a/plugins/modules/dynamodb_ttl.py b/plugins/modules/dynamodb_ttl.py index d4ed856c215..c042ee50442 100644 --- a/plugins/modules/dynamodb_ttl.py +++ b/plugins/modules/dynamodb_ttl.py @@ -46,13 +46,13 @@ EXAMPLES = ''' - name: enable TTL on my cowfacts table - dynamodb_ttl: + community.aws.dynamodb_ttl: state: enable table_name: cowfacts attribute_name: cow_deleted_date - name: disable TTL on my cowfacts table - dynamodb_ttl: + community.aws.dynamodb_ttl: state: disable table_name: cowfacts attribute_name: cow_deleted_date diff --git a/plugins/modules/ec2_ami_copy.py b/plugins/modules/ec2_ami_copy.py index 832d3155a91..15fb3afde98 100644 --- a/plugins/modules/ec2_ami_copy.py +++ b/plugins/modules/ec2_ami_copy.py @@ -79,14 +79,14 @@ ''' EXAMPLES = ''' -# Basic AMI Copy -- ec2_ami_copy: +- name: Basic AMI Copy + community.aws.ec2_ami_copy: source_region: us-east-1 region: eu-west-1 source_image_id: ami-xxxxxxx -# AMI copy wait until available -- ec2_ami_copy: +- name: AMI copy wait until available + community.aws.ec2_ami_copy: source_region: us-east-1 region: eu-west-1 source_image_id: ami-xxxxxxx @@ -94,16 +94,16 @@ wait_timeout: 1200 # Default timeout is 600 register: image_id -# Named AMI copy -- ec2_ami_copy: +- name: Named AMI copy + community.aws.ec2_ami_copy: source_region: us-east-1 region: eu-west-1 source_image_id: ami-xxxxxxx name: My-Awesome-AMI description: latest patch -# Tagged AMI copy (will not copy the same AMI twice) -- ec2_ami_copy: +- name: Tagged AMI copy (will not copy the same AMI twice) + community.aws.ec2_ami_copy: source_region: us-east-1 region: eu-west-1 source_image_id: ami-xxxxxxx @@ -112,15 +112,15 @@ Patch: 1.2.3 tag_equality: yes -# Encrypted AMI copy -- ec2_ami_copy: +- name: Encrypted AMI copy + community.aws.ec2_ami_copy: source_region: us-east-1 region: eu-west-1 source_image_id: ami-xxxxxxx encrypted: yes -# Encrypted AMI copy with specified key -- ec2_ami_copy: +- name: Encrypted AMI copy with specified key + community.aws.ec2_ami_copy: source_region: us-east-1 region: eu-west-1 source_image_id: ami-xxxxxxx diff --git a/plugins/modules/ec2_asg.py b/plugins/modules/ec2_asg.py index 3a852e1a0e3..8d2c6612bb4 100644 --- a/plugins/modules/ec2_asg.py +++ b/plugins/modules/ec2_asg.py @@ -16,7 +16,7 @@ short_description: Create or delete AWS AutoScaling Groups (ASGs) description: - Can create or delete AWS AutoScaling Groups. - - Can be used with the M(ec2_lc) module to manage Launch Configurations. + - Can be used with the M(community.aws.ec2_lc) module to manage Launch Configurations. author: "Gareth Rushgrove (@garethr)" requirements: [ "boto3", "botocore" ] options: @@ -49,7 +49,7 @@ elements: str launch_config_name: description: - - Name of the Launch configuration to use for the group. See the M(ec2_lc) module for managing these. + - Name of the Launch configuration to use for the group. See the community.aws.ec2_lc) module for managing these. - If unspecified then the current group value will be used. One of I(launch_config_name) or I(launch_template) must be provided. type: str launch_template: @@ -247,7 +247,7 @@ EXAMPLES = ''' # Basic configuration with Launch Configuration -- ec2_asg: +- community.aws.ec2_asg: name: special load_balancers: [ 'lb1', 'lb2' ] availability_zones: [ 'eu-west-1a', 'eu-west-1b' ] @@ -273,7 +273,7 @@ # will have the current launch configuration. - name: create launch config - ec2_lc: + community.aws.ec2_lc: name: my_new_lc image_id: ami-lkajsf key_name: mykey @@ -282,7 +282,7 @@ instance_type: m1.small assign_public_ip: yes -- ec2_asg: +- community.aws.ec2_asg: name: myasg launch_config_name: my_new_lc health_check_period: 60 @@ -296,7 +296,7 @@ # To only replace a couple of instances instead of all of them, supply a list # to "replace_instances": -- ec2_asg: +- community.aws.ec2_asg: name: myasg launch_config_name: my_new_lc health_check_period: 60 @@ -311,7 +311,7 @@ # Basic Configuration with Launch Template -- ec2_asg: +- community.aws.ec2_asg: name: special load_balancers: [ 'lb1', 'lb2' ] availability_zones: [ 'eu-west-1a', 'eu-west-1b' ] @@ -329,7 +329,7 @@ # Basic Configuration with Launch Template using mixed instance policy -- ec2_asg: +- community.aws.ec2_asg: name: special load_balancers: [ 'lb1', 'lb2' ] availability_zones: [ 'eu-west-1a', 'eu-west-1b' ] diff --git a/plugins/modules/ec2_asg_info.py b/plugins/modules/ec2_asg_info.py index 0f30eaa47bc..196b9f6e4b4 100644 --- a/plugins/modules/ec2_asg_info.py +++ b/plugins/modules/ec2_asg_info.py @@ -43,37 +43,37 @@ EXAMPLES = ''' # Note: These examples do not set authentication details, see the AWS Guide for details. -# Find all groups -- ec2_asg_info: +- name: Find all groups + community.aws.ec2_asg_info: register: asgs -# Find a group with matching name/prefix -- ec2_asg_info: +- name: Find a group with matching name/prefix + community.aws.ec2_asg_info: name: public-webserver-asg register: asgs -# Find a group with matching tags -- ec2_asg_info: +- name: Find a group with matching tags + community.aws.ec2_asg_info: tags: project: webapp env: production register: asgs -# Find a group with matching name/prefix and tags -- ec2_asg_info: +- name: Find a group with matching name/prefix and tags + community.aws.ec2_asg_info: name: myproject tags: env: production register: asgs -# Fail if no groups are found -- ec2_asg_info: +- name: Fail if no groups are found + community.aws.ec2_asg_info: name: public-webserver-asg register: asgs failed_when: "{{ asgs.results | length == 0 }}" -# Fail if more than 1 group is found -- ec2_asg_info: +- name: Fail if more than 1 group is found + community.aws.ec2_asg_info: name: public-webserver-asg register: asgs failed_when: "{{ asgs.results | length > 1 }}" diff --git a/plugins/modules/ec2_asg_lifecycle_hook.py b/plugins/modules/ec2_asg_lifecycle_hook.py index 25f143f1ce5..2f340d0d534 100644 --- a/plugins/modules/ec2_asg_lifecycle_hook.py +++ b/plugins/modules/ec2_asg_lifecycle_hook.py @@ -81,8 +81,8 @@ ''' EXAMPLES = ''' -# Create / Update lifecycle hook -- ec2_asg_lifecycle_hook: +- name: Create / Update lifecycle hook + community.aws.ec2_asg_lifecycle_hook: region: eu-central-1 state: present autoscaling_group_name: example @@ -91,8 +91,8 @@ heartbeat_timeout: 7000 default_result: ABANDON -# Delete lifecycle hook -- ec2_asg_lifecycle_hook: +- name: Delete lifecycle hook + community.aws.ec2_asg_lifecycle_hook: region: eu-central-1 state: absent autoscaling_group_name: example diff --git a/plugins/modules/ec2_customer_gateway.py b/plugins/modules/ec2_customer_gateway.py index d14ffcfbce4..a1447d4d61d 100644 --- a/plugins/modules/ec2_customer_gateway.py +++ b/plugins/modules/ec2_customer_gateway.py @@ -58,17 +58,16 @@ ''' EXAMPLES = ''' - -# Create Customer Gateway -- ec2_customer_gateway: +- name: Create Customer Gateway + community.aws.ec2_customer_gateway: bgp_asn: 12345 ip_address: 1.2.3.4 name: IndianapolisOffice region: us-east-1 register: cgw -# Delete Customer Gateway -- ec2_customer_gateway: +- name: Delete Customer Gateway + community.aws.ec2_customer_gateway: ip_address: 1.2.3.4 name: IndianapolisOffice state: absent diff --git a/plugins/modules/ec2_customer_gateway_info.py b/plugins/modules/ec2_customer_gateway_info.py index 65ed984f486..a634fcfbfd4 100644 --- a/plugins/modules/ec2_customer_gateway_info.py +++ b/plugins/modules/ec2_customer_gateway_info.py @@ -39,10 +39,10 @@ # # Note: These examples do not set authentication details, see the AWS Guide for details. - name: Gather information about all customer gateways - ec2_customer_gateway_info: + community.aws.ec2_customer_gateway_info: - name: Gather information about a filtered list of customer gateways, based on tags - ec2_customer_gateway_info: + community.aws.ec2_customer_gateway_info: region: ap-southeast-2 filters: "tag:Name": test-customer-gateway @@ -50,7 +50,7 @@ register: cust_gw_info - name: Gather information about a specific customer gateway by specifying customer gateway ID - ec2_customer_gateway_info: + community.aws.ec2_customer_gateway_info: region: ap-southeast-2 customer_gateway_ids: - 'cgw-48841a09' diff --git a/plugins/modules/ec2_eip.py b/plugins/modules/ec2_eip.py index b7441826a9b..ea4033c0c0c 100644 --- a/plugins/modules/ec2_eip.py +++ b/plugins/modules/ec2_eip.py @@ -104,39 +104,39 @@ # Note: These examples do not set authentication details, see the AWS Guide for details. - name: associate an elastic IP with an instance - ec2_eip: + community.aws.ec2_eip: device_id: i-1212f003 ip: 93.184.216.119 - name: associate an elastic IP with a device - ec2_eip: + community.aws.ec2_eip: device_id: eni-c8ad70f3 ip: 93.184.216.119 - name: associate an elastic IP with a device and allow reassociation - ec2_eip: + community.aws.ec2_eip: device_id: eni-c8ad70f3 public_ip: 93.184.216.119 allow_reassociation: true - name: disassociate an elastic IP from an instance - ec2_eip: + community.aws.ec2_eip: device_id: i-1212f003 ip: 93.184.216.119 state: absent - name: disassociate an elastic IP with a device - ec2_eip: + community.aws.ec2_eip: device_id: eni-c8ad70f3 ip: 93.184.216.119 state: absent - name: allocate a new elastic IP and associate it with an instance - ec2_eip: + community.aws.ec2_eip: device_id: i-1212f003 - name: allocate a new elastic IP without associating it to anything - ec2_eip: + community.aws.ec2_eip: state: present register: eip @@ -145,7 +145,7 @@ msg: "Allocated IP is {{ eip.public_ip }}" - name: provision new instances with ec2 - ec2: + amazon.aws.ec2: keypair: mykey instance_type: c1.medium image: ami-40603AD1 @@ -155,12 +155,12 @@ register: ec2 - name: associate new elastic IPs with each of the instances - ec2_eip: + community.aws.ec2_eip: device_id: "{{ item }}" loop: "{{ ec2.instance_ids }}" - name: allocate a new elastic IP inside a VPC in us-west-2 - ec2_eip: + community.aws.ec2_eip: region: us-west-2 in_vpc: true register: eip @@ -170,14 +170,14 @@ msg: "Allocated IP inside a VPC is {{ eip.public_ip }}" - name: allocate eip - reuse unallocated ips (if found) with FREE tag - ec2_eip: + community.aws.ec2_eip: region: us-east-1 in_vpc: true reuse_existing_ip_allowed: true tag_name: FREE -- name: allocate eip - reuse unallocted ips if tag reserved is nope - ec2_eip: +- name: allocate eip - reuse unallocated ips if tag reserved is nope + community.aws.ec2_eip: region: us-east-1 in_vpc: true reuse_existing_ip_allowed: true @@ -185,13 +185,13 @@ tag_value: nope - name: allocate new eip - from servers given ipv4 pool - ec2_eip: + community.aws.ec2_eip: region: us-east-1 in_vpc: true public_ipv4_pool: ipv4pool-ec2-0588c9b75a25d1a02 - name: allocate eip - from a given pool (if no free addresses where dev-servers tag is dynamic) - ec2_eip: + community.aws.ec2_eip: region: us-east-1 in_vpc: true reuse_existing_ip_allowed: true @@ -199,7 +199,7 @@ public_ipv4_pool: ipv4pool-ec2-0588c9b75a25d1a02 - name: allocate eip from pool - check if tag reserved_for exists and value is our hostname - ec2_eip: + community.aws.ec2_eip: region: us-east-1 in_vpc: true reuse_existing_ip_allowed: true diff --git a/plugins/modules/ec2_eip_info.py b/plugins/modules/ec2_eip_info.py index 047041ff755..779506ef054 100644 --- a/plugins/modules/ec2_eip_info.py +++ b/plugins/modules/ec2_eip_info.py @@ -37,34 +37,35 @@ # Note: These examples do not set authentication details or the AWS region, # see the AWS Guide for details. -# List all EIP addresses in the current region. -- ec2_eip_info: +- name: List all EIP addresses in the current region. + community.aws.ec2_eip_info: register: regional_eip_addresses -# List all EIP addresses for a VM. -- ec2_eip_info: +- name: List all EIP addresses for a VM. + community.aws.ec2_eip_info: filters: instance-id: i-123456789 register: my_vm_eips -- debug: msg="{{ my_vm_eips.addresses | json_query(\"[?private_ip_address=='10.0.0.5']\") }}" +- debug: + msg: "{{ my_vm_eips.addresses | json_query(\"[?private_ip_address=='10.0.0.5']\") }}" -# List all EIP addresses for several VMs. -- ec2_eip_info: +- name: List all EIP addresses for several VMs. + community.aws.ec2_eip_info: filters: instance-id: - i-123456789 - i-987654321 register: my_vms_eips -# List all EIP addresses using the 'Name' tag as a filter. -- ec2_eip_info: +- name: List all EIP addresses using the 'Name' tag as a filter. + community.aws.ec2_eip_info: filters: tag:Name: www.example.com register: my_vms_eips -# List all EIP addresses using the Allocation-id as a filter -- ec2_eip_info: +- name: List all EIP addresses using the Allocation-id as a filter + community.aws.ec2_eip_info: filters: allocation-id: eipalloc-64de1b01 register: my_vms_eips diff --git a/plugins/modules/ec2_elb.py b/plugins/modules/ec2_elb.py index bf77dbca503..397c5508640 100644 --- a/plugins/modules/ec2_elb.py +++ b/plugins/modules/ec2_elb.py @@ -64,19 +64,15 @@ EXAMPLES = """ # basic pre_task and post_task example pre_tasks: - - name: Gathering ec2 facts - action: ec2_facts - name: Instance De-register - local_action: - module: ec2_elb + community.aws.ec2_elb: instance_id: "{{ ansible_ec2_instance_id }}" state: absent roles: - myrole post_tasks: - name: Instance Register - local_action: - module: ec2_elb + community.aws.ec2_elb: instance_id: "{{ ansible_ec2_instance_id }}" ec2_elbs: "{{ item }}" state: present diff --git a/plugins/modules/ec2_elb_info.py b/plugins/modules/ec2_elb_info.py index d83b4fe119d..81694bf21c3 100644 --- a/plugins/modules/ec2_elb_info.py +++ b/plugins/modules/ec2_elb_info.py @@ -44,38 +44,31 @@ EXAMPLES = ''' # Note: These examples do not set authentication details, see the AWS Guide for details. -# Output format tries to match ec2_elb_lb module input parameters +# Output format tries to match amazon.aws.ec2_elb_lb module input parameters -# Gather information about all ELBs -- action: - module: ec2_elb_info +- name: Gather information about all ELBs + ec2_elb_info: register: elb_info - -- action: - module: debug +- debug: msg: "{{ item.dns_name }}" loop: "{{ elb_info.elbs }}" -# Gather information about a particular ELB -- action: - module: ec2_elb_info +- name: Gather information about a particular ELB + community.aws.ec2_elb_info: names: frontend-prod-elb register: elb_info -- action: - module: debug +- debug: msg: "{{ elb_info.elbs.0.dns_name }}" -# Gather information about a set of ELBs -- action: - module: ec2_elb_info +- name: Gather information about a set of ELBs + ec2_elb_info: names: - frontend-prod-elb - backend-prod-elb register: elb_info -- action: - module: debug +- debug: msg: "{{ item.dns_name }}" loop: "{{ elb_info.elbs }}" diff --git a/plugins/modules/ec2_instance.py b/plugins/modules/ec2_instance.py index 0b268a6f05a..85d3ed2f91d 100644 --- a/plugins/modules/ec2_instance.py +++ b/plugins/modules/ec2_instance.py @@ -18,7 +18,7 @@ - Create and manage AWS EC2 instances. - > Note: This module does not support creating - L(EC2 Spot instances,https://aws.amazon.com/ec2/spot/). The M(ec2) module + L(EC2 Spot instances,https://aws.amazon.com/ec2/spot/). The M(amazon.aws.ec2) module can create and manage spot instances. author: - Ryan Scott Brown (@ryansb) @@ -86,7 +86,7 @@ type: bool image: description: - - An image to use for the instance. The M(ec2_ami_info) module may be used to retrieve images. + - An image to use for the instance. The M(amazon.aws.ec2_ami_info) module may be used to retrieve images. One of I(image) or I(image_id) are required when instance is not already present. type: dict suboptions: @@ -121,14 +121,14 @@ vpc_subnet_id: description: - The subnet ID in which to launch the instance (VPC) - If none is provided, ec2_instance will chose the default zone of the default VPC. + If none is provided, M(community.aws.ec2_instance) will chose the default zone of the default VPC. aliases: ['subnet_id'] type: str network: description: - Either a dictionary containing the key 'interfaces' corresponding to a list of network interface IDs or containing specifications for a single network interface. - - Use the ec2_eni module to create ENIs with special settings. + - Use the M(amazon.aws.ec2_eni) module to create ENIs with special settings. type: dict suboptions: interfaces: @@ -286,20 +286,20 @@ EXAMPLES = ''' # Note: These examples do not set authentication details, see the AWS Guide for details. -# Terminate every running instance in a region. Use with EXTREME caution. -- ec2_instance: +- name: Terminate every running instance in a region. Use with EXTREME caution. + community.aws.ec2_instance: state: absent filters: instance-state-name: running -# restart a particular instance by its ID -- ec2_instance: +- name: restart a particular instance by its ID + community.aws.ec2_instance: state: restarted instance_ids: - i-12345678 -# start an instance with a public IP address -- ec2_instance: +- name: start an instance with a public IP address + community.aws.ec2_instance: name: "public-compute-instance" key_name: "prod-ssh-key" vpc_subnet_id: subnet-5ca1ab1e @@ -311,8 +311,8 @@ tags: Environment: Testing -# start an instance and Add EBS -- ec2_instance: +- name: start an instance and Add EBS + community.aws.ec2_instance: name: "public-withebs-instance" vpc_subnet_id: subnet-5ca1ab1e instance_type: t2.micro @@ -324,8 +324,8 @@ volume_size: 16 delete_on_termination: true -# start an instance with a cpu_options -- ec2_instance: +- name: start an instance with a cpu_options + community.aws.ec2_instance: name: "public-cpuoption-instance" vpc_subnet_id: subnet-5ca1ab1e tags: @@ -339,8 +339,8 @@ core_count: 1 threads_per_core: 1 -# start an instance and have it begin a Tower callback on boot -- ec2_instance: +- name: start an instance and have it begin a Tower callback on boot + community.aws.ec2_instance: name: "tower-callback-test" key_name: "prod-ssh-key" vpc_subnet_id: subnet-5ca1ab1e @@ -357,8 +357,8 @@ tags: SomeThing: "A value" -# start an instance with ENI (An existing ENI ID is required) -- ec2_instance: +- name: start an instance with ENI (An existing ENI ID is required) + community.aws.ec2_instance: name: "public-eni-instance" key_name: "prod-ssh-key" vpc_subnet_id: subnet-5ca1ab1e @@ -374,8 +374,8 @@ instance_type: t2.micro image_id: ami-123456 -# add second ENI interface -- ec2_instance: +- name: add second ENI interface + community.aws.ec2_instance: name: "public-eni-instance" network: interfaces: diff --git a/plugins/modules/ec2_instance_info.py b/plugins/modules/ec2_instance_info.py index 9bb1ff56e7d..cd5365342ae 100644 --- a/plugins/modules/ec2_instance_info.py +++ b/plugins/modules/ec2_instance_info.py @@ -45,26 +45,26 @@ EXAMPLES = ''' # Note: These examples do not set authentication details, see the AWS Guide for details. -# Gather information about all instances -- ec2_instance_info: +- name: Gather information about all instances + community.aws.ec2_instance_info: -# Gather information about all instances in AZ ap-southeast-2a -- ec2_instance_info: +- name: Gather information about all instances in AZ ap-southeast-2a + community.aws.ec2_instance_info: filters: availability-zone: ap-southeast-2a -# Gather information about a particular instance using ID -- ec2_instance_info: +- name: Gather information about a particular instance using ID + community.aws.ec2_instance_info: instance_ids: - i-12345678 -# Gather information about any instance with a tag key Name and value Example -- ec2_instance_info: +- name: Gather information about any instance with a tag key Name and value Example + community.aws.ec2_instance_info: filters: "tag:Name": Example -# Gather information about any instance in states "shutting-down", "stopping", "stopped" -- ec2_instance_info: +- name: Gather information about any instance in states "shutting-down", "stopping", "stopped" + community.aws.ec2_instance_info: filters: instance-state-name: [ "shutting-down", "stopping", "stopped" ] diff --git a/plugins/modules/ec2_launch_template.py b/plugins/modules/ec2_launch_template.py index 2de514ad247..3be1f15b65a 100644 --- a/plugins/modules/ec2_launch_template.py +++ b/plugins/modules/ec2_launch_template.py @@ -17,7 +17,7 @@ description: - Create, modify, and delete EC2 Launch Templates, which can be used to create individual instances or with Autoscaling Groups. - - The I(ec2_instance) and I(ec2_asg) modules can, instead of specifying all + - The M(community.aws.ec2_instance) and M(community.aws.ec2_asg) modules can, instead of specifying all parameters on those tasks, be passed a Launch Template which contains settings like instance size, disk type, subnet, and more. requirements: @@ -224,7 +224,7 @@ type: str key_name: description: - - The name of the key pair. You can create a key pair using M(ec2_key). + - The name of the key pair. You can create a key pair using M(amazon.aws.ec2_key). - If you do not specify a key pair, you can't connect to the instance unless you choose an AMI that is configured to allow users another way to log in. @@ -331,7 +331,7 @@ EXAMPLES = ''' - name: Create an ec2 launch template - ec2_launch_template: + community.aws.ec2_launch_template: name: "my_template" image_id: "ami-04b762b4289fba92b" key_name: my_ssh_key @@ -342,13 +342,13 @@ - name: > Create a new version of an existing ec2 launch template with a different instance type, while leaving an older version as the default version - ec2_launch_template: + community.aws.ec2_launch_template: name: "my_template" default_version: 1 instance_type: c5.4xlarge - name: Delete an ec2 launch template - ec2_launch_template: + community.aws.ec2_launch_template: name: "my_template" state: absent diff --git a/plugins/modules/ec2_lc.py b/plugins/modules/ec2_lc.py index 5211391d1cf..652bdc5c92f 100644 --- a/plugins/modules/ec2_lc.py +++ b/plugins/modules/ec2_lc.py @@ -198,7 +198,7 @@ # create a launch configuration using an AMI image and instance type as a basis - name: note that encrypted volumes are only supported in >= Ansible 2.4 - ec2_lc: + community.aws.ec2_lc: name: special image_id: ami-XXX key_name: default @@ -214,9 +214,8 @@ - device_name: /dev/sdb ephemeral: ephemeral0 -# create a launch configuration using a running instance id as a basis - -- ec2_lc: +- name: create a launch configuration using a running instance id as a basis + community.aws.ec2_lc: name: special instance_id: i-00a48b207ec59e948 key_name: default @@ -228,9 +227,8 @@ iops: 3000 delete_on_termination: true -# create a launch configuration to omit the /dev/sdf EBS device that is included in the AMI image - -- ec2_lc: +- name: create a launch configuration to omit the /dev/sdf EBS device that is included in the AMI image + community.aws.ec2_lc: name: special image_id: ami-XXX key_name: default @@ -254,7 +252,7 @@ encrypted: no - name: Create launch configuration - ec2_lc: + community.aws.ec2_lc: name: lc1 image_id: ami-xxxx assign_public_ip: yes diff --git a/plugins/modules/ec2_lc_find.py b/plugins/modules/ec2_lc_find.py index 8ff3ddb0c39..70c5292e0df 100644 --- a/plugins/modules/ec2_lc_find.py +++ b/plugins/modules/ec2_lc_find.py @@ -54,8 +54,8 @@ EXAMPLES = ''' # Note: These examples do not set authentication details, see the AWS Guide for details. -# Search for the Launch Configurations that start with "app" -- ec2_lc_find: +- name: Search for the Launch Configurations that start with "app" + community.aws.ec2_lc_find: name_regex: app.* sort_order: descending limit: 2 diff --git a/plugins/modules/ec2_lc_info.py b/plugins/modules/ec2_lc_info.py index 9a16f2fd0ab..40ef6273620 100644 --- a/plugins/modules/ec2_lc_info.py +++ b/plugins/modules/ec2_lc_info.py @@ -59,15 +59,15 @@ EXAMPLES = ''' # Note: These examples do not set authentication details, see the AWS Guide for details. -# Gather information about all launch configurations -- ec2_lc_info: +- name: Gather information about all launch configurations + community.aws.ec2_lc_info: -# Gather information about launch configuration with name "example" -- ec2_lc_info: +- name: Gather information about launch configuration with name "example" + community.aws.ec2_lc_info: name: example -# Gather information sorted by created_time from most recent to least recent -- ec2_lc_info: +- name: Gather information sorted by created_time from most recent to least recent + community.aws.ec2_lc_info: sort: created_time sort_order: descending ''' diff --git a/plugins/modules/ec2_metric_alarm.py b/plugins/modules/ec2_metric_alarm.py index 6d87ea9595b..1c345aafe35 100644 --- a/plugins/modules/ec2_metric_alarm.py +++ b/plugins/modules/ec2_metric_alarm.py @@ -172,7 +172,7 @@ EXAMPLES = ''' - name: create alarm - ec2_metric_alarm: + community.aws.ec2_metric_alarm: state: present region: ap-southeast-2 name: "cpu-low" @@ -189,7 +189,7 @@ alarm_actions: ["action1","action2"] - name: Create an alarm to recover a failed instance - ec2_metric_alarm: + community.aws.ec2_metric_alarm: state: present region: us-west-1 name: "recover-instance" diff --git a/plugins/modules/ec2_placement_group.py b/plugins/modules/ec2_placement_group.py index f4b3a7e2fbf..212d1eb8a5b 100644 --- a/plugins/modules/ec2_placement_group.py +++ b/plugins/modules/ec2_placement_group.py @@ -50,19 +50,19 @@ # Note: These examples do not set authentication details, see the AWS Guide # for details. -# Create a placement group. -- ec2_placement_group: +- name: Create a placement group. + community.aws.ec2_placement_group: name: my-cluster state: present -# Create a Spread placement group. -- ec2_placement_group: +- name: Create a Spread placement group. + community.aws.ec2_placement_group: name: my-cluster state: present strategy: spread -# Delete a placement group. -- ec2_placement_group: +- name: Delete a placement group. + community.aws.ec2_placement_group: name: my-cluster state: absent diff --git a/plugins/modules/ec2_placement_group_info.py b/plugins/modules/ec2_placement_group_info.py index 47df4dd7ed4..19efcc524d2 100644 --- a/plugins/modules/ec2_placement_group_info.py +++ b/plugins/modules/ec2_placement_group_info.py @@ -37,18 +37,19 @@ # Note: These examples do not set authentication details or the AWS region, # see the AWS Guide for details. -# List all placement groups. -- ec2_placement_group_info: +- name: List all placement groups. + community.aws.ec2_placement_group_info: register: all_ec2_placement_groups -# List two placement groups. -- ec2_placement_group_info: +- name: List two placement groups. + community.aws.ec2_placement_group_info: names: - my-cluster - my-other-cluster register: specific_ec2_placement_groups -- debug: msg="{{ specific_ec2_placement_groups | json_query(\"[?name=='my-cluster']\") }}" +- debug: + msg: "{{ specific_ec2_placement_groups | json_query(\"[?name=='my-cluster']\") }}" ''' diff --git a/plugins/modules/ec2_scaling_policy.py b/plugins/modules/ec2_scaling_policy.py index 01b3210afde..788c717144a 100644 --- a/plugins/modules/ec2_scaling_policy.py +++ b/plugins/modules/ec2_scaling_policy.py @@ -59,7 +59,7 @@ ''' EXAMPLES = ''' -- ec2_scaling_policy: +- community.aws.ec2_scaling_policy: state: present region: US-XXX name: "scaledown-policy" diff --git a/plugins/modules/ec2_snapshot_copy.py b/plugins/modules/ec2_snapshot_copy.py index 98ac9c8b4df..bbfb4dcf557 100644 --- a/plugins/modules/ec2_snapshot_copy.py +++ b/plugins/modules/ec2_snapshot_copy.py @@ -67,14 +67,14 @@ ''' EXAMPLES = ''' -# Basic Snapshot Copy -- ec2_snapshot_copy: +- name: Basic Snapshot Copy + community.aws.ec2_snapshot_copy: source_region: eu-central-1 region: eu-west-1 source_snapshot_id: snap-xxxxxxx -# Copy Snapshot and wait until available -- ec2_snapshot_copy: +- name: Copy Snapshot and wait until available + community.aws.ec2_snapshot_copy: source_region: eu-central-1 region: eu-west-1 source_snapshot_id: snap-xxxxxxx @@ -82,23 +82,23 @@ wait_timeout: 1200 # Default timeout is 600 register: snapshot_id -# Tagged Snapshot copy -- ec2_snapshot_copy: +- name: Tagged Snapshot copy + community.aws.ec2_snapshot_copy: source_region: eu-central-1 region: eu-west-1 source_snapshot_id: snap-xxxxxxx tags: Name: Snapshot-Name -# Encrypted Snapshot copy -- ec2_snapshot_copy: +- name: Encrypted Snapshot copy + community.aws.ec2_snapshot_copy: source_region: eu-central-1 region: eu-west-1 source_snapshot_id: snap-xxxxxxx encrypted: yes -# Encrypted Snapshot copy with specified key -- ec2_snapshot_copy: +- name: Encrypted Snapshot copy with specified key + community.aws.ec2_snapshot_copy: source_region: eu-central-1 region: eu-west-1 source_snapshot_id: snap-xxxxxxx diff --git a/plugins/modules/ec2_transit_gateway.py b/plugins/modules/ec2_transit_gateway.py index 9ab13d83042..7c0996072b9 100644 --- a/plugins/modules/ec2_transit_gateway.py +++ b/plugins/modules/ec2_transit_gateway.py @@ -94,14 +94,14 @@ EXAMPLES = ''' - name: Create a new transit gateway using defaults - ec2_transit_gateway: + community.aws.ec2_transit_gateway: state: present region: us-east-1 description: personal-testing register: created_tgw - name: Create a new transit gateway with options - ec2_transit_gateway: + community.aws.ec2_transit_gateway: asn: 64514 auto_associate: no auto_propagate: no @@ -115,13 +115,13 @@ status: testing - name: Remove a transit gateway by description - ec2_transit_gateway: + community.aws.ec2_transit_gateway: state: absent region: us-east-1 description: personal-testing - name: Remove a transit gateway by id - ec2_transit_gateway: + community.aws.ec2_transit_gateway: state: absent region: ap-southeast-2 transit_gateway_id: tgw-3a9aa123 diff --git a/plugins/modules/ec2_transit_gateway_info.py b/plugins/modules/ec2_transit_gateway_info.py index e4fbb14821e..d628ffbfbb6 100644 --- a/plugins/modules/ec2_transit_gateway_info.py +++ b/plugins/modules/ec2_transit_gateway_info.py @@ -41,22 +41,22 @@ EXAMPLES = ''' # Note: These examples do not set authentication details, see the AWS Guide for details. -# Gather info about all transit gateways -- ec2_transit_gateway_info: +- name: Gather info about all transit gateways + community.aws.ec2_transit_gateway_info: -# Gather info about a particular transit gateway using filter transit gateway ID -- ec2_transit_gateway_info: +- name: Gather info about a particular transit gateway using filter transit gateway ID + community.aws.ec2_transit_gateway_info: filters: transit-gateway-id: tgw-02c42332e6b7da829 -# Gather info about a particular transit gateway using multiple option filters -- ec2_transit_gateway_info: +- name: Gather info about a particular transit gateway using multiple option filters + community.aws.ec2_transit_gateway_info: filters: options.dns-support: enable options.vpn-ecmp-support: enable -# Gather info about multiple transit gateways using module param -- ec2_transit_gateway_info: +- name: Gather info about multiple transit gateways using module param + community.aws.ec2_transit_gateway_info: transit_gateway_ids: - tgw-02c42332e6b7da829 - tgw-03c53443d5a8cb716 diff --git a/plugins/modules/ec2_vpc_egress_igw.py b/plugins/modules/ec2_vpc_egress_igw.py index 6f0c1ab36b1..3a0b75129c5 100644 --- a/plugins/modules/ec2_vpc_egress_igw.py +++ b/plugins/modules/ec2_vpc_egress_igw.py @@ -40,10 +40,10 @@ # Ensure that the VPC has an Internet Gateway. # The Internet Gateway ID is can be accessed via {{eigw.gateway_id}} for use in setting up NATs etc. -ec2_vpc_egress_igw: - vpc_id: vpc-abcdefgh - state: present -register: eigw +- community.aws.ec2_vpc_egress_igw: + vpc_id: vpc-abcdefgh + state: present + register: eigw ''' diff --git a/plugins/modules/ec2_vpc_endpoint.py b/plugins/modules/ec2_vpc_endpoint.py index 760af35c62e..65c76bc05a8 100644 --- a/plugins/modules/ec2_vpc_endpoint.py +++ b/plugins/modules/ec2_vpc_endpoint.py @@ -27,7 +27,7 @@ type: str service: description: - - An AWS supported vpc endpoint service. Use the M(ec2_vpc_endpoint_info) + - An AWS supported vpc endpoint service. Use the M(community.aws.ec2_vpc_endpoint_info) module to describe the supported endpoint services. - Required when creating an endpoint. required: false @@ -104,7 +104,7 @@ # Note: These examples do not set authentication details, see the AWS Guide for details. - name: Create new vpc endpoint with a json template for policy - ec2_vpc_endpoint: + community.aws.ec2_vpc_endpoint: state: present region: ap-southeast-2 vpc_id: vpc-12345678 @@ -116,7 +116,7 @@ register: new_vpc_endpoint - name: Create new vpc endpoint with the default policy - ec2_vpc_endpoint: + community.aws.ec2_vpc_endpoint: state: present region: ap-southeast-2 vpc_id: vpc-12345678 @@ -127,7 +127,7 @@ register: new_vpc_endpoint - name: Create new vpc endpoint with json file - ec2_vpc_endpoint: + community.aws.ec2_vpc_endpoint: state: present region: ap-southeast-2 vpc_id: vpc-12345678 @@ -139,7 +139,7 @@ register: new_vpc_endpoint - name: Delete newly created vpc endpoint - ec2_vpc_endpoint: + community.aws.ec2_vpc_endpoint: state: absent vpc_endpoint_id: "{{ new_vpc_endpoint.result['VpcEndpointId'] }}" region: ap-southeast-2 diff --git a/plugins/modules/ec2_vpc_endpoint_info.py b/plugins/modules/ec2_vpc_endpoint_info.py index a43ef54ac13..ebd7b0a996c 100644 --- a/plugins/modules/ec2_vpc_endpoint_info.py +++ b/plugins/modules/ec2_vpc_endpoint_info.py @@ -47,19 +47,19 @@ EXAMPLES = ''' # Simple example of listing all support AWS services for VPC endpoints - name: List supported AWS endpoint services - ec2_vpc_endpoint_info: + community.aws.ec2_vpc_endpoint_info: query: services region: ap-southeast-2 register: supported_endpoint_services - name: Get all endpoints in ap-southeast-2 region - ec2_vpc_endpoint_info: + community.aws.ec2_vpc_endpoint_info: query: endpoints region: ap-southeast-2 register: existing_endpoints - name: Get all endpoints with specific filters - ec2_vpc_endpoint_info: + community.aws.ec2_vpc_endpoint_info: query: endpoints region: ap-southeast-2 filters: @@ -72,7 +72,7 @@ register: existing_endpoints - name: Get details on specific endpoint - ec2_vpc_endpoint_info: + community.aws.ec2_vpc_endpoint_info: query: endpoints region: ap-southeast-2 vpc_endpoint_ids: diff --git a/plugins/modules/ec2_vpc_igw.py b/plugins/modules/ec2_vpc_igw.py index 43b74c163d5..f4b4e443d06 100644 --- a/plugins/modules/ec2_vpc_igw.py +++ b/plugins/modules/ec2_vpc_igw.py @@ -49,10 +49,10 @@ # Ensure that the VPC has an Internet Gateway. # The Internet Gateway ID is can be accessed via {{igw.gateway_id}} for use in setting up NATs etc. -ec2_vpc_igw: - vpc_id: vpc-abcdefgh - state: present -register: igw +- community.aws.ec2_vpc_igw: + vpc_id: vpc-abcdefgh + state: present + register: igw ''' diff --git a/plugins/modules/ec2_vpc_igw_info.py b/plugins/modules/ec2_vpc_igw_info.py index 1c407a36b89..012b7cb09a5 100644 --- a/plugins/modules/ec2_vpc_igw_info.py +++ b/plugins/modules/ec2_vpc_igw_info.py @@ -41,13 +41,13 @@ # # Note: These examples do not set authentication details, see the AWS Guide for details. - name: Gather information about all Internet Gateways for an account or profile - ec2_vpc_igw_info: + community.aws.ec2_vpc_igw_info: region: ap-southeast-2 profile: production register: igw_info - name: Gather information about a filtered list of Internet Gateways - ec2_vpc_igw_info: + community.aws.ec2_vpc_igw_info: region: ap-southeast-2 profile: production filters: @@ -55,7 +55,7 @@ register: igw_info - name: Gather information about a specific internet gateway by InternetGatewayId - ec2_vpc_igw_info: + community.aws.ec2_vpc_igw_info: region: ap-southeast-2 profile: production internet_gateway_ids: igw-c1231234 diff --git a/plugins/modules/ec2_vpc_nacl.py b/plugins/modules/ec2_vpc_nacl.py index 213cf167cd4..74693091dfa 100644 --- a/plugins/modules/ec2_vpc_nacl.py +++ b/plugins/modules/ec2_vpc_nacl.py @@ -91,7 +91,7 @@ # Complete example to create and delete a network ACL # that allows SSH, HTTP and ICMP in, and all traffic out. - name: "Create and associate production DMZ network ACL with DMZ subnets" - ec2_vpc_nacl: + community.aws.ec2_vpc_nacl: vpc_id: vpc-12345678 name: prod-dmz-nacl region: ap-southeast-2 @@ -111,7 +111,7 @@ state: 'present' - name: "Remove the ingress and egress rules - defaults to deny all" - ec2_vpc_nacl: + community.aws.ec2_vpc_nacl: vpc_id: vpc-12345678 name: prod-dmz-nacl region: ap-southeast-2 @@ -125,20 +125,20 @@ state: present - name: "Remove the NACL subnet associations and tags" - ec2_vpc_nacl: + community.aws.ec2_vpc_nacl: vpc_id: 'vpc-12345678' name: prod-dmz-nacl region: ap-southeast-2 state: present - name: "Delete nacl and subnet associations" - ec2_vpc_nacl: + community.aws.ec2_vpc_nacl: vpc_id: vpc-12345678 name: prod-dmz-nacl state: absent - name: "Delete nacl by its id" - ec2_vpc_nacl: + community.aws.ec2_vpc_nacl: nacl_id: acl-33b4ee5b state: absent ''' diff --git a/plugins/modules/ec2_vpc_nacl_info.py b/plugins/modules/ec2_vpc_nacl_info.py index b5a8d3bc251..4eedf3535b5 100644 --- a/plugins/modules/ec2_vpc_nacl_info.py +++ b/plugins/modules/ec2_vpc_nacl_info.py @@ -49,17 +49,17 @@ # Gather information about all Network ACLs: - name: Get All NACLs - register: all_nacls - ec2_vpc_nacl_info: + community.aws.ec2_vpc_nacl_info: region: us-west-2 + register: all_nacls # Retrieve default Network ACLs: - name: Get Default NACLs - register: default_nacls - ec2_vpc_nacl_info: + community.aws.ec2_vpc_nacl_info: region: us-west-2 filters: 'default': 'true' + register: default_nacls ''' RETURN = ''' diff --git a/plugins/modules/ec2_vpc_nat_gateway.py b/plugins/modules/ec2_vpc_nat_gateway.py index 09fc70de335..a0565c5707b 100644 --- a/plugins/modules/ec2_vpc_nat_gateway.py +++ b/plugins/modules/ec2_vpc_nat_gateway.py @@ -89,7 +89,7 @@ # Note: These examples do not set authentication details, see the AWS Guide for details. - name: Create new nat gateway with client token. - ec2_vpc_nat_gateway: + community.aws.ec2_vpc_nat_gateway: state: present subnet_id: subnet-12345678 eip_address: 52.1.1.1 @@ -98,7 +98,7 @@ register: new_nat_gateway - name: Create new nat gateway using an allocation-id. - ec2_vpc_nat_gateway: + community.aws.ec2_vpc_nat_gateway: state: present subnet_id: subnet-12345678 allocation_id: eipalloc-12345678 @@ -106,7 +106,7 @@ register: new_nat_gateway - name: Create new nat gateway, using an EIP address and wait for available status. - ec2_vpc_nat_gateway: + community.aws.ec2_vpc_nat_gateway: state: present subnet_id: subnet-12345678 eip_address: 52.1.1.1 @@ -115,7 +115,7 @@ register: new_nat_gateway - name: Create new nat gateway and allocate new EIP. - ec2_vpc_nat_gateway: + community.aws.ec2_vpc_nat_gateway: state: present subnet_id: subnet-12345678 wait: true @@ -123,7 +123,7 @@ register: new_nat_gateway - name: Create new nat gateway and allocate new EIP if a nat gateway does not yet exist in the subnet. - ec2_vpc_nat_gateway: + community.aws.ec2_vpc_nat_gateway: state: present subnet_id: subnet-12345678 wait: true @@ -132,7 +132,7 @@ register: new_nat_gateway - name: Delete nat gateway using discovered nat gateways from facts module. - ec2_vpc_nat_gateway: + community.aws.ec2_vpc_nat_gateway: state: absent region: ap-southeast-2 wait: true @@ -142,7 +142,7 @@ loop: "{{ gateways_to_remove.result }}" - name: Delete nat gateway and wait for deleted status. - ec2_vpc_nat_gateway: + community.aws.ec2_vpc_nat_gateway: state: absent nat_gateway_id: nat-12345678 wait: true @@ -150,7 +150,7 @@ region: ap-southeast-2 - name: Delete nat gateway and release EIP. - ec2_vpc_nat_gateway: + community.aws.ec2_vpc_nat_gateway: state: absent nat_gateway_id: nat-12345678 release_eip: true diff --git a/plugins/modules/ec2_vpc_nat_gateway_info.py b/plugins/modules/ec2_vpc_nat_gateway_info.py index a4891391854..ac8f70f9f1c 100644 --- a/plugins/modules/ec2_vpc_nat_gateway_info.py +++ b/plugins/modules/ec2_vpc_nat_gateway_info.py @@ -40,7 +40,7 @@ EXAMPLES = ''' # Simple example of listing all nat gateways - name: List all managed nat gateways in ap-southeast-2 - ec2_vpc_nat_gateway_info: + community.aws.ec2_vpc_nat_gateway_info: region: ap-southeast-2 register: all_ngws @@ -49,7 +49,7 @@ msg: "{{ all_ngws.result }}" - name: Get details on specific nat gateways - ec2_vpc_nat_gateway_info: + community.aws.ec2_vpc_nat_gateway_info: nat_gateway_ids: - nat-1234567891234567 - nat-7654321987654321 @@ -57,14 +57,14 @@ register: specific_ngws - name: Get all nat gateways with specific filters - ec2_vpc_nat_gateway_info: + community.aws.ec2_vpc_nat_gateway_info: region: ap-southeast-2 filters: state: ['pending'] register: pending_ngws - name: Get nat gateways with specific filter - ec2_vpc_nat_gateway_info: + community.aws.ec2_vpc_nat_gateway_info: region: ap-southeast-2 filters: subnet-id: subnet-12345678 diff --git a/plugins/modules/ec2_vpc_peer.py b/plugins/modules/ec2_vpc_peer.py index 28de7788ef0..26a338f49d8 100644 --- a/plugins/modules/ec2_vpc_peer.py +++ b/plugins/modules/ec2_vpc_peer.py @@ -66,7 +66,7 @@ EXAMPLES = ''' # Complete example to create and accept a local peering connection. - name: Create local account VPC peering Connection - ec2_vpc_peer: + community.aws.ec2_vpc_peer: region: ap-southeast-2 vpc_id: vpc-12345678 peer_vpc_id: vpc-87654321 @@ -78,7 +78,7 @@ register: vpc_peer - name: Accept local VPC peering request - ec2_vpc_peer: + community.aws.ec2_vpc_peer: region: ap-southeast-2 peering_id: "{{ vpc_peer.peering_id }}" state: accept @@ -86,7 +86,7 @@ # Complete example to delete a local peering connection. - name: Create local account VPC peering Connection - ec2_vpc_peer: + community.aws.ec2_vpc_peer: region: ap-southeast-2 vpc_id: vpc-12345678 peer_vpc_id: vpc-87654321 @@ -98,7 +98,7 @@ register: vpc_peer - name: delete a local VPC peering Connection - ec2_vpc_peer: + community.aws.ec2_vpc_peer: region: ap-southeast-2 peering_id: "{{ vpc_peer.peering_id }}" state: absent @@ -106,7 +106,7 @@ # Complete example to create and accept a cross account peering connection. - name: Create cross account VPC peering Connection - ec2_vpc_peer: + community.aws.ec2_vpc_peer: region: ap-southeast-2 vpc_id: vpc-12345678 peer_vpc_id: vpc-12345678 @@ -119,7 +119,7 @@ register: vpc_peer - name: Accept peering connection from remote account - ec2_vpc_peer: + community.aws.ec2_vpc_peer: region: ap-southeast-2 peering_id: "{{ vpc_peer.peering_id }}" profile: bot03_profile_for_cross_account @@ -128,7 +128,7 @@ # Complete example to create and accept an intra-region peering connection. - name: Create intra-region VPC peering Connection - ec2_vpc_peer: + community.aws.ec2_vpc_peer: region: us-east-1 vpc_id: vpc-12345678 peer_vpc_id: vpc-87654321 @@ -141,7 +141,7 @@ register: vpc_peer - name: Accept peering connection from peer region - ec2_vpc_peer: + community.aws.ec2_vpc_peer: region: us-west-2 peering_id: "{{ vpc_peer.peering_id }}" state: accept @@ -149,7 +149,7 @@ # Complete example to create and reject a local peering connection. - name: Create local account VPC peering Connection - ec2_vpc_peer: + community.aws.ec2_vpc_peer: region: ap-southeast-2 vpc_id: vpc-12345678 peer_vpc_id: vpc-87654321 @@ -161,14 +161,14 @@ register: vpc_peer - name: Reject a local VPC peering Connection - ec2_vpc_peer: + community.aws.ec2_vpc_peer: region: ap-southeast-2 peering_id: "{{ vpc_peer.peering_id }}" state: reject # Complete example to create and accept a cross account peering connection. - name: Create cross account VPC peering Connection - ec2_vpc_peer: + community.aws.ec2_vpc_peer: region: ap-southeast-2 vpc_id: vpc-12345678 peer_vpc_id: vpc-12345678 @@ -181,7 +181,7 @@ register: vpc_peer - name: Accept a cross account VPC peering connection request - ec2_vpc_peer: + community.aws.ec2_vpc_peer: region: ap-southeast-2 peering_id: "{{ vpc_peer.peering_id }}" profile: bot03_profile_for_cross_account @@ -193,7 +193,7 @@ # Complete example to create and reject a cross account peering connection. - name: Create cross account VPC peering Connection - ec2_vpc_peer: + community.aws.ec2_vpc_peer: region: ap-southeast-2 vpc_id: vpc-12345678 peer_vpc_id: vpc-12345678 @@ -206,7 +206,7 @@ register: vpc_peer - name: Reject a cross account VPC peering Connection - ec2_vpc_peer: + community.aws.ec2_vpc_peer: region: ap-southeast-2 peering_id: "{{ vpc_peer.peering_id }}" profile: bot03_profile_for_cross_account diff --git a/plugins/modules/ec2_vpc_peering_info.py b/plugins/modules/ec2_vpc_peering_info.py index 2561a209283..2db5b929a2c 100644 --- a/plugins/modules/ec2_vpc_peering_info.py +++ b/plugins/modules/ec2_vpc_peering_info.py @@ -39,7 +39,7 @@ EXAMPLES = ''' # Simple example of listing all VPC Peers - name: List all vpc peers - ec2_vpc_peering_info: + community.aws.ec2_vpc_peering_info: region: ap-southeast-2 register: all_vpc_peers @@ -48,7 +48,7 @@ msg: "{{ all_vpc_peers.result }}" - name: Get details on specific VPC peer - ec2_vpc_peering_info: + community.aws.ec2_vpc_peering_info: peer_connection_ids: - pcx-12345678 - pcx-87654321 @@ -56,7 +56,7 @@ register: all_vpc_peers - name: Get all vpc peers with specific filters - ec2_vpc_peering_info: + community.aws.ec2_vpc_peering_info: region: ap-southeast-2 filters: status-code: ['pending-acceptance'] diff --git a/plugins/modules/ec2_vpc_route_table.py b/plugins/modules/ec2_vpc_route_table.py index a90242148b2..578069e92d9 100644 --- a/plugins/modules/ec2_vpc_route_table.py +++ b/plugins/modules/ec2_vpc_route_table.py @@ -89,7 +89,7 @@ # Basic creation example: - name: Set up public subnet route table - ec2_vpc_route_table: + community.aws.ec2_vpc_route_table: vpc_id: vpc-1245678 region: us-west-1 tags: @@ -104,7 +104,7 @@ register: public_route_table - name: Set up NAT-protected route table - ec2_vpc_route_table: + community.aws.ec2_vpc_route_table: vpc_id: vpc-1245678 region: us-west-1 tags: @@ -119,7 +119,7 @@ register: nat_route_table - name: delete route table - ec2_vpc_route_table: + community.aws.ec2_vpc_route_table: vpc_id: vpc-1245678 region: us-west-1 route_table_id: "{{ route_table.id }}" diff --git a/plugins/modules/ec2_vpc_route_table_info.py b/plugins/modules/ec2_vpc_route_table_info.py index a86e9542570..cd8224c82e7 100644 --- a/plugins/modules/ec2_vpc_route_table_info.py +++ b/plugins/modules/ec2_vpc_route_table_info.py @@ -34,21 +34,21 @@ EXAMPLES = ''' # Note: These examples do not set authentication details, see the AWS Guide for details. -# Gather information about all VPC route tables -- ec2_vpc_route_table_info: +- name: Gather information about all VPC route tables + community.aws.ec2_vpc_route_table_info: -# Gather information about a particular VPC route table using route table ID -- ec2_vpc_route_table_info: +- name: Gather information about a particular VPC route table using route table ID + community.aws.ec2_vpc_route_table_info: filters: route-table-id: rtb-00112233 -# Gather information about any VPC route table with a tag key Name and value Example -- ec2_vpc_route_table_info: +- name: Gather information about any VPC route table with a tag key Name and value Example + community.aws.ec2_vpc_route_table_info: filters: "tag:Name": Example -# Gather information about any VPC route table within VPC with ID vpc-abcdef00 -- ec2_vpc_route_table_info: +- name: Gather information about any VPC route table within VPC with ID vpc-abcdef00 + community.aws.ec2_vpc_route_table_info: filters: vpc-id: vpc-abcdef00 diff --git a/plugins/modules/ec2_vpc_vgw.py b/plugins/modules/ec2_vpc_vgw.py index 8fce681bbe8..4dc92b9f36b 100644 --- a/plugins/modules/ec2_vpc_vgw.py +++ b/plugins/modules/ec2_vpc_vgw.py @@ -69,7 +69,7 @@ EXAMPLES = ''' - name: Create a new vgw attached to a specific VPC - ec2_vpc_vgw: + community.aws.ec2_vpc_vgw: state: present region: ap-southeast-2 profile: personal @@ -79,7 +79,7 @@ register: created_vgw - name: Create a new unattached vgw - ec2_vpc_vgw: + community.aws.ec2_vpc_vgw: state: present region: ap-southeast-2 profile: personal @@ -91,7 +91,7 @@ register: created_vgw - name: Remove a new vgw using the name - ec2_vpc_vgw: + community.aws.ec2_vpc_vgw: state: absent region: ap-southeast-2 profile: personal @@ -100,7 +100,7 @@ register: deleted_vgw - name: Remove a new vgw using the vpn_gateway_id - ec2_vpc_vgw: + community.aws.ec2_vpc_vgw: state: absent region: ap-southeast-2 profile: personal diff --git a/plugins/modules/ec2_vpc_vgw_info.py b/plugins/modules/ec2_vpc_vgw_info.py index 64f522d80db..0c4fbc7602d 100644 --- a/plugins/modules/ec2_vpc_vgw_info.py +++ b/plugins/modules/ec2_vpc_vgw_info.py @@ -41,13 +41,13 @@ # # Note: These examples do not set authentication details, see the AWS Guide for details. - name: Gather information about all virtual gateways for an account or profile - ec2_vpc_vgw_info: + community.aws.ec2_vpc_vgw_info: region: ap-southeast-2 profile: production register: vgw_info - name: Gather information about a filtered list of Virtual Gateways - ec2_vpc_vgw_info: + community.aws.ec2_vpc_vgw_info: region: ap-southeast-2 profile: production filters: @@ -55,7 +55,7 @@ register: vgw_info - name: Gather information about a specific virtual gateway by VpnGatewayIds - ec2_vpc_vgw_info: + community.aws.ec2_vpc_vgw_info: region: ap-southeast-2 profile: production vpn_gateway_ids: vgw-c432f6a7 diff --git a/plugins/modules/ec2_vpc_vpn.py b/plugins/modules/ec2_vpc_vpn.py index 5f8707bf909..a4f9306279e 100644 --- a/plugins/modules/ec2_vpc_vpn.py +++ b/plugins/modules/ec2_vpc_vpn.py @@ -149,13 +149,13 @@ # It is assumed that their matching environment variables are set. - name: create a VPN connection - ec2_vpc_vpn: + community.aws.ec2_vpc_vpn: state: present vpn_gateway_id: vgw-XXXXXXXX customer_gateway_id: cgw-XXXXXXXX - name: modify VPN connection tags - ec2_vpc_vpn: + community.aws.ec2_vpc_vpn: state: present vpn_connection_id: vpn-XXXXXXXX tags: @@ -163,12 +163,12 @@ Other: ansible-tag-2 - name: delete a connection - ec2_vpc_vpn: + community.aws.ec2_vpc_vpn: vpn_connection_id: vpn-XXXXXXXX state: absent - name: modify VPN tags (identifying VPN by filters) - ec2_vpc_vpn: + community.aws.ec2_vpc_vpn: state: present filters: cidr: 194.168.1.0/24 @@ -181,7 +181,7 @@ static_only: true - name: set up VPN with tunnel options utilizing 'TunnelInsideCidr' only - ec2_vpc_vpn: + community.aws.ec2_vpc_vpn: state: present filters: vpn: vpn-XXXXXXXX @@ -193,7 +193,7 @@ TunnelInsideCidr: '169.254.100.5/30' - name: add routes and remove any preexisting ones - ec2_vpc_vpn: + community.aws.ec2_vpc_vpn: state: present filters: vpn: vpn-XXXXXXXX @@ -203,14 +203,14 @@ purge_routes: true - name: remove all routes - ec2_vpc_vpn: + community.aws.ec2_vpc_vpn: state: present vpn_connection_id: vpn-XXXXXXXX routes: [] purge_routes: true - name: delete a VPN identified by filters - ec2_vpc_vpn: + community.aws.ec2_vpc_vpn: state: absent filters: tags: diff --git a/plugins/modules/ec2_vpc_vpn_info.py b/plugins/modules/ec2_vpc_vpn_info.py index 991977346d0..3c7890500d9 100644 --- a/plugins/modules/ec2_vpc_vpn_info.py +++ b/plugins/modules/ec2_vpc_vpn_info.py @@ -42,16 +42,16 @@ EXAMPLES = ''' # # Note: These examples do not set authentication details, see the AWS Guide for details. - name: Gather information about all vpn connections - ec2_vpc_vpn_info: + community.aws.ec2_vpc_vpn_info: - name: Gather information about a filtered list of vpn connections, based on tags - ec2_vpc_vpn_info: + community.aws.ec2_vpc_vpn_info: filters: "tag:Name": test-connection register: vpn_conn_info - name: Gather information about vpn connections by specifying connection IDs. - ec2_vpc_vpn_info: + community.aws.ec2_vpc_vpn_info: filters: vpn-gateway-id: vgw-cbe66beb register: vpn_conn_info diff --git a/plugins/modules/ec2_win_password.py b/plugins/modules/ec2_win_password.py index 7ed14ed7204..7f0bc38bc1e 100644 --- a/plugins/modules/ec2_win_password.py +++ b/plugins/modules/ec2_win_password.py @@ -69,7 +69,7 @@ EXAMPLES = ''' # Example of getting a password - name: get the Administrator password - ec2_win_password: + community.aws.ec2_win_password: profile: my-boto-profile instance_id: i-XXXXXX region: us-east-1 @@ -77,7 +77,7 @@ # Example of getting a password using a variable - name: get the Administrator password - ec2_win_password: + community.aws.ec2_win_password: profile: my-boto-profile instance_id: i-XXXXXX region: us-east-1 @@ -85,7 +85,7 @@ # Example of getting a password with a password protected key - name: get the Administrator password - ec2_win_password: + community.aws.ec2_win_password: profile: my-boto-profile instance_id: i-XXXXXX region: us-east-1 @@ -94,7 +94,7 @@ # Example of waiting for a password - name: get the Administrator password - ec2_win_password: + community.aws.ec2_win_password: profile: my-boto-profile instance_id: i-XXXXXX region: us-east-1 diff --git a/plugins/modules/ecs_attribute.py b/plugins/modules/ecs_attribute.py index 9e812275e9e..9a5d0f77eeb 100644 --- a/plugins/modules/ecs_attribute.py +++ b/plugins/modules/ecs_attribute.py @@ -66,8 +66,8 @@ EXAMPLES = ''' # Note: These examples do not set authentication details, see the AWS Guide for details. -# Set attributes -- ecs_attribute: +- name: Set attributes + community.aws.ecs_attribute: state: present cluster: test-cluster ec2_instance_id: "{{ ec2_id }}" @@ -76,8 +76,8 @@ - migrated delegate_to: localhost -# Delete attributes -- ecs_attribute: +- name: Delete attributes + community.aws.ecs_attribute: state: absent cluster: test-cluster ec2_instance_id: "{{ ec2_id }}" diff --git a/plugins/modules/ecs_cluster.py b/plugins/modules/ecs_cluster.py index 6e6cc54b255..9d10267ff02 100644 --- a/plugins/modules/ecs_cluster.py +++ b/plugins/modules/ecs_cluster.py @@ -55,18 +55,18 @@ EXAMPLES = ''' # Note: These examples do not set authentication details, see the AWS Guide for details. -# Cluster creation -- ecs_cluster: +- name: Cluster creation + community.aws.ecs_cluster: name: default state: present -# Cluster deletion -- ecs_cluster: +- name: Cluster deletion + community.aws.ecs_cluster: name: default state: absent - name: Wait for register - ecs_cluster: + community.aws.ecs_cluster: name: "{{ new_cluster }}" state: has_instances delay: 10 diff --git a/plugins/modules/ecs_ecr.py b/plugins/modules/ecs_ecr.py index 4d2bf1bab09..18d8721467e 100644 --- a/plugins/modules/ecs_ecr.py +++ b/plugins/modules/ecs_ecr.py @@ -88,16 +88,21 @@ # If the repository does not exist, it is created. If it does exist, would not # affect any policies already on it. - name: ecr-repo - ecs_ecr: name=super/cool + community.aws.ecs_ecr: + name: super/cool - name: destroy-ecr-repo - ecs_ecr: name=old/busted state=absent + community.aws.ecs_ecr: + name: old/busted + state: absent - name: Cross account ecr-repo - ecs_ecr: registry_id=999999999999 name=cross/account + community.aws.ecs_ecr: + registry_id: 999999999999 + name: cross/account - name: set-policy as object - ecs_ecr: + community.aws.ecs_ecr: name: needs-policy-object policy: Version: '2008-10-17' @@ -112,22 +117,22 @@ - ecr:BatchCheckLayerAvailability - name: set-policy as string - ecs_ecr: + community.aws.ecs_ecr: name: needs-policy-string policy: "{{ lookup('template', 'policy.json.j2') }}" - name: delete-policy - ecs_ecr: + community.aws.ecs_ecr: name: needs-no-policy purge_policy: yes - name: create immutable ecr-repo - ecs_ecr: + community.aws.ecs_ecr: name: super/cool image_tag_mutability: immutable - name: set-lifecycle-policy - ecs_ecr: + community.aws.ecs_ecr: name: needs-lifecycle-policy lifecycle_policy: rules: @@ -142,7 +147,7 @@ type: expire - name: purge-lifecycle-policy - ecs_ecr: + community.aws.ecs_ecr: name: needs-no-lifecycle-policy purge_lifecycle_policy: true ''' diff --git a/plugins/modules/ecs_service.py b/plugins/modules/ecs_service.py index 1446704a598..b5cd6cb745e 100644 --- a/plugins/modules/ecs_service.py +++ b/plugins/modules/ecs_service.py @@ -193,7 +193,7 @@ # Note: These examples do not set authentication details, see the AWS Guide for details. # Basic provisioning example -- ecs_service: +- community.aws.ecs_service: state: present name: console-test-service cluster: new_cluster @@ -201,7 +201,7 @@ desired_count: 0 - name: create ECS service on VPC network - ecs_service: + community.aws.ecs_service: state: present name: console-test-service cluster: new_cluster @@ -215,13 +215,13 @@ - my_security_group # Simple example to delete -- ecs_service: +- community.aws.ecs_service: name: default state: absent cluster: new_cluster # With custom deployment configuration (added in version 2.3), placement constraints and strategy (added in version 2.4) -- ecs_service: +- community.aws.ecs_service: state: present name: test-service cluster: test-cluster diff --git a/plugins/modules/ecs_service_info.py b/plugins/modules/ecs_service_info.py index f82f5c5e6a8..c155f5520aa 100644 --- a/plugins/modules/ecs_service_info.py +++ b/plugins/modules/ecs_service_info.py @@ -17,7 +17,7 @@ description: - Lists or describes services in ECS. - This module was called C(ecs_service_facts) before Ansible 2.9, returning C(ansible_facts). - Note that the M(ecs_service_info) module no longer returns C(ansible_facts)! + Note that the M(community.aws.ecs_service_info) module no longer returns C(ansible_facts)! author: - "Mark Chance (@Java1Guy)" - "Darek Kaczynski (@kaczynskid)" @@ -56,14 +56,14 @@ # Note: These examples do not set authentication details, see the AWS Guide for details. # Basic listing example -- ecs_service_info: +- community.aws.ecs_service_info: cluster: test-cluster service: console-test-service details: true register: output # Basic listing example -- ecs_service_info: +- community.aws.ecs_service_info: cluster: test-cluster register: output ''' diff --git a/plugins/modules/ecs_tag.py b/plugins/modules/ecs_tag.py index a9def34ac41..f5980195410 100644 --- a/plugins/modules/ecs_tag.py +++ b/plugins/modules/ecs_tag.py @@ -62,7 +62,7 @@ EXAMPLES = r''' - name: Ensure tags are present on a resource - ecs_tag: + community.aws.ecs_tag: cluster_name: mycluster resource_type: cluster state: present @@ -71,7 +71,7 @@ env: prod - name: Remove the Env tag - ecs_tag: + community.aws.ecs_tag: cluster_name: mycluster resource_type: cluster tags: @@ -79,7 +79,7 @@ state: absent - name: Remove the Env tag if it's currently 'development' - ecs_tag: + community.aws.ecs_tag: cluster_name: mycluster resource_type: cluster tags: @@ -87,7 +87,7 @@ state: absent - name: Remove all tags except for Name from a cluster - ecs_tag: + community.aws.ecs_tag: cluster_name: mycluster resource_type: cluster tags: diff --git a/plugins/modules/ecs_task.py b/plugins/modules/ecs_task.py index 41c381c269a..e5e74b9620c 100644 --- a/plugins/modules/ecs_task.py +++ b/plugins/modules/ecs_task.py @@ -95,7 +95,7 @@ EXAMPLES = ''' # Simple example of run task - name: Run task - ecs_task: + community.aws.ecs_task: operation: run cluster: console-sample-app-static-cluster task_definition: console-sample-app-static-taskdef @@ -106,7 +106,7 @@ # Simple example of start task - name: Start a task - ecs_task: + community.aws.ecs_task: operation: start cluster: console-sample-app-static-cluster task_definition: console-sample-app-static-taskdef @@ -128,7 +128,7 @@ register: task_output - name: RUN a task on Fargate - ecs_task: + community.aws.ecs_task: operation: run cluster: console-sample-app-static-cluster task_definition: console-sample-app-static-taskdef @@ -144,7 +144,7 @@ register: task_output - name: Stop a task - ecs_task: + community.aws.ecs_task: operation: stop cluster: console-sample-app-static-cluster task_definition: console-sample-app-static-taskdef diff --git a/plugins/modules/ecs_taskdefinition.py b/plugins/modules/ecs_taskdefinition.py index 895a52d29d1..b1021f6ce83 100644 --- a/plugins/modules/ecs_taskdefinition.py +++ b/plugins/modules/ecs_taskdefinition.py @@ -110,7 +110,7 @@ EXAMPLES = ''' - name: Create task definition - ecs_taskdefinition: + community.aws.ecs_taskdefinition: containers: - name: simple-app cpu: 10 @@ -151,7 +151,7 @@ register: task_output - name: Create task definition - ecs_taskdefinition: + community.aws.ecs_taskdefinition: family: nginx containers: - name: nginx @@ -165,7 +165,7 @@ state: present - name: Create task definition - ecs_taskdefinition: + community.aws.ecs_taskdefinition: family: nginx containers: - name: nginx @@ -182,7 +182,7 @@ # Create Task Definition with Environment Variables and Secrets - name: Create task definition - ecs_taskdefinition: + community.aws.ecs_taskdefinition: family: nginx containers: - name: nginx diff --git a/plugins/modules/ecs_taskdefinition_info.py b/plugins/modules/ecs_taskdefinition_info.py index 2c6fe847cea..d5963f7e4db 100644 --- a/plugins/modules/ecs_taskdefinition_info.py +++ b/plugins/modules/ecs_taskdefinition_info.py @@ -40,7 +40,7 @@ EXAMPLES = ''' # Note: These examples do not set authentication details, see the AWS Guide for details. -- ecs_taskdefinition_info: +- community.aws.ecs_taskdefinition_info: task_definition: test-td ''' diff --git a/plugins/modules/efs.py b/plugins/modules/efs.py index 5d72daa2c02..4e457144c78 100644 --- a/plugins/modules/efs.py +++ b/plugins/modules/efs.py @@ -111,8 +111,8 @@ ''' EXAMPLES = ''' -# EFS provisioning -- efs: +- name: EFS provisioning + community.aws.efs: state: present name: myTestEFS tags: @@ -122,8 +122,8 @@ - subnet_id: subnet-748c5d03 security_groups: [ "sg-1a2b3c4d" ] -# Modifying EFS data -- efs: +- name: Modifying EFS data + community.aws.efs: state: present name: myTestEFS tags: @@ -132,8 +132,8 @@ - subnet_id: subnet-7654fdca security_groups: [ "sg-4c5d6f7a" ] -# Deleting EFS -- efs: +- name: Deleting EFS + community.aws.efs: state: absent name: myTestEFS ''' diff --git a/plugins/modules/efs_info.py b/plugins/modules/efs_info.py index 69a584215fe..75d05f505bc 100644 --- a/plugins/modules/efs_info.py +++ b/plugins/modules/efs_info.py @@ -18,7 +18,7 @@ description: - This module can be used to search Amazon EFS file systems. - This module was called C(efs_facts) before Ansible 2.9, returning C(ansible_facts). - Note that the M(efs_info) module no longer returns C(ansible_facts)! + Note that the M(community.aws.efs_info) module no longer returns C(ansible_facts)! requirements: [ boto3 ] author: - "Ryan Sydnor (@ryansydnor)" @@ -50,16 +50,16 @@ EXAMPLES = ''' - name: Find all existing efs - efs_info: + community.aws.efs_info: register: result - name: Find efs using id - efs_info: + community.aws.efs_info: id: fs-1234abcd register: result - name: Searching all EFS instances with tag Name = 'myTestNameTag', in subnet 'subnet-1a2b3c4d' and with security group 'sg-4d3c2b1a' - efs_info: + community.aws.efs_info: tags: Name: myTestNameTag targets: diff --git a/plugins/modules/elasticache.py b/plugins/modules/elasticache.py index a59eadc11e9..cec7228fa15 100644 --- a/plugins/modules/elasticache.py +++ b/plugins/modules/elasticache.py @@ -105,8 +105,8 @@ # Note: None of these examples set aws_access_key, aws_secret_key, or region. # It is assumed that their matching environment variables are set. -# Basic example -- elasticache: +- name: Basic example + community.aws.elasticache: name: "test-please-delete" state: present engine: memcached @@ -119,13 +119,13 @@ zone: us-east-1d -# Ensure cache cluster is gone -- elasticache: +- name: Ensure cache cluster is gone + community.aws.elasticache: name: "test-please-delete" state: absent -# Reboot cache cluster -- elasticache: +- name: Reboot cache cluster + community.aws.elasticache: name: "test-please-delete" state: rebooted diff --git a/plugins/modules/elasticache_info.py b/plugins/modules/elasticache_info.py index 9126ee57f4e..83ef5128527 100644 --- a/plugins/modules/elasticache_info.py +++ b/plugins/modules/elasticache_info.py @@ -32,10 +32,10 @@ EXAMPLES = ''' - name: obtain all ElastiCache information - elasticache_info: + community.aws.elasticache_info: - name: obtain all information for a single ElastiCache cluster - elasticache_info: + community.aws.elasticache_info: name: test_elasticache ''' diff --git a/plugins/modules/elasticache_parameter_group.py b/plugins/modules/elasticache_parameter_group.py index 9e64320def2..97731d88116 100644 --- a/plugins/modules/elasticache_parameter_group.py +++ b/plugins/modules/elasticache_parameter_group.py @@ -60,24 +60,24 @@ connection: local tasks: - name: 'Create a test parameter group' - elasticache_parameter_group: + community.aws.elasticache_parameter_group: name: 'test-param-group' group_family: 'redis3.2' description: 'This is a cache parameter group' state: 'present' - name: 'Modify a test parameter group' - elasticache_parameter_group: + community.aws.elasticache_parameter_group: name: 'test-param-group' values: activerehashing: yes client-output-buffer-limit-normal-hard-limit: 4 state: 'present' - name: 'Reset all modifiable parameters for the test parameter group' - elasticache_parameter_group: + community.aws.elasticache_parameter_group: name: 'test-param-group' state: reset - name: 'Delete a test parameter group' - elasticache_parameter_group: + community.aws.elasticache_parameter_group: name: 'test-param-group' state: 'absent' """ diff --git a/plugins/modules/elasticache_snapshot.py b/plugins/modules/elasticache_snapshot.py index 7bea35dee8c..37935535684 100644 --- a/plugins/modules/elasticache_snapshot.py +++ b/plugins/modules/elasticache_snapshot.py @@ -57,16 +57,13 @@ EXAMPLES = """ # Note: None of these examples set aws_access_key, aws_secret_key, or region. # It is assumed that their matching environment variables are set. ---- -- hosts: localhost - connection: local - tasks: - - name: 'Create a snapshot' - elasticache_snapshot: - name: 'test-snapshot' - state: 'present' - cluster_id: '{{ cluster }}' - replication_id: '{{ replication }}' + +- name: 'Create a snapshot' + community.aws.elasticache_snapshot: + name: 'test-snapshot' + state: 'present' + cluster_id: '{{ cluster }}' + replication_id: '{{ replication }}' """ RETURN = """ diff --git a/plugins/modules/elasticache_subnet_group.py b/plugins/modules/elasticache_subnet_group.py index ed56153c4f9..e555a4c8ebd 100644 --- a/plugins/modules/elasticache_subnet_group.py +++ b/plugins/modules/elasticache_subnet_group.py @@ -46,8 +46,8 @@ ''' EXAMPLES = ''' -# Add or change a subnet group -- elasticache_subnet_group: +- name: Add or change a subnet group + community.aws.elasticache_subnet_group: state: present name: norwegian-blue description: My Fancy Ex Parrot Subnet Group @@ -55,8 +55,8 @@ - subnet-aaaaaaaa - subnet-bbbbbbbb -# Remove a subnet group -- elasticache_subnet_group: +- name: Remove a subnet group + community.aws.elasticache_subnet_group: state: absent name: norwegian-blue ''' diff --git a/plugins/modules/elb_application_lb.py b/plugins/modules/elb_application_lb.py index 9c49e648409..4d07e8bd232 100644 --- a/plugins/modules/elb_application_lb.py +++ b/plugins/modules/elb_application_lb.py @@ -188,7 +188,7 @@ # Note: These examples do not set authentication details, see the AWS Guide for details. # Create an ELB and attach a listener -- elb_application_lb: +- community.aws.elb_application_lb: name: myelb security_groups: - sg-12345678 @@ -209,7 +209,7 @@ state: present # Create an ELB and attach a listener with logging enabled -- elb_application_lb: +- community.aws.elb_application_lb: access_logs_enabled: yes access_logs_s3_bucket: mybucket access_logs_s3_prefix: "logs" @@ -233,7 +233,7 @@ state: present # Create an ALB with listeners and rules -- elb_application_lb: +- community.aws.elb_application_lb: name: test-alb subnets: - subnet-12345678 @@ -296,7 +296,7 @@ state: present # Remove an ELB -- elb_application_lb: +- community.aws.elb_application_lb: name: myelb state: absent diff --git a/plugins/modules/elb_application_lb_info.py b/plugins/modules/elb_application_lb_info.py index b347941ee79..cb58d1e1c17 100644 --- a/plugins/modules/elb_application_lb_info.py +++ b/plugins/modules/elb_application_lb_info.py @@ -40,22 +40,22 @@ EXAMPLES = ''' # Note: These examples do not set authentication details, see the AWS Guide for details. -# Gather information about all target groups -- elb_application_lb_info: +- name: Gather information about all target groups + community.aws.elb_application_lb_info: -# Gather information about the target group attached to a particular ELB -- elb_application_lb_info: +- name: Gather information about the target group attached to a particular ELB + community.aws.elb_application_lb_info: load_balancer_arns: - "arn:aws:elasticloadbalancing:ap-southeast-2:001122334455:loadbalancer/app/my-elb/aabbccddeeff" -# Gather information about a target groups named 'tg1' and 'tg2' -- elb_application_lb_info: +- name: Gather information about a target groups named 'tg1' and 'tg2' + community.aws.elb_application_lb_info: names: - elb1 - elb2 -# Gather information about specific ALB -- elb_application_lb_info: +- name: Gather information about specific ALB + community.aws.elb_application_lb_info: names: "alb-name" region: "aws-region" register: alb_info diff --git a/plugins/modules/elb_classic_lb.py b/plugins/modules/elb_classic_lb.py index 5959ebaf3f0..747455f688e 100644 --- a/plugins/modules/elb_classic_lb.py +++ b/plugins/modules/elb_classic_lb.py @@ -143,7 +143,7 @@ # Basic provisioning example (non-VPC) -- elb_classic_lb: +- community.aws.elb_classic_lb: name: "test-please-delete" state: present zones: @@ -164,7 +164,7 @@ # Internal ELB example -- elb_classic_lb: +- community.aws.elb_classic_lb: name: "test-vpc" scheme: internal state: present @@ -181,7 +181,7 @@ delegate_to: localhost # Configure a health check and the access logs -- elb_classic_lb: +- community.aws.elb_classic_lb: name: "test-please-delete" state: present zones: @@ -205,20 +205,20 @@ delegate_to: localhost # Ensure ELB is gone -- elb_classic_lb: +- community.aws.elb_classic_lb: name: "test-please-delete" state: absent delegate_to: localhost # Ensure ELB is gone and wait for check (for default timeout) -- elb_classic_lb: +- community.aws.elb_classic_lb: name: "test-please-delete" state: absent wait: yes delegate_to: localhost # Ensure ELB is gone and wait for check with timeout value -- elb_classic_lb: +- community.aws.elb_classic_lb: name: "test-please-delete" state: absent wait: yes @@ -228,7 +228,7 @@ # Normally, this module will purge any listeners that exist on the ELB # but aren't specified in the listeners parameter. If purge_listeners is # false it leaves them alone -- elb_classic_lb: +- community.aws.elb_classic_lb: name: "test-please-delete" state: present zones: @@ -244,7 +244,7 @@ # Normally, this module will leave availability zones that are enabled # on the ELB alone. If purge_zones is true, then any extraneous zones # will be removed -- elb_classic_lb: +- community.aws.elb_classic_lb: name: "test-please-delete" state: present zones: @@ -258,7 +258,7 @@ delegate_to: localhost # Creates a ELB and assigns a list of subnets to it. -- elb_classic_lb: +- community.aws.elb_classic_lb: state: present name: 'New ELB' security_group_ids: 'sg-123456, sg-67890' @@ -273,7 +273,7 @@ # Create an ELB with connection draining, increased idle timeout and cross availability # zone load balancing -- elb_classic_lb: +- community.aws.elb_classic_lb: name: "New ELB" state: present connection_draining_timeout: 60 @@ -290,7 +290,7 @@ delegate_to: localhost # Create an ELB with load balancer stickiness enabled -- elb_classic_lb: +- community.aws.elb_classic_lb: name: "New ELB" state: present region: us-east-1 @@ -308,7 +308,7 @@ delegate_to: localhost # Create an ELB with application stickiness enabled -- elb_classic_lb: +- community.aws.elb_classic_lb: name: "New ELB" state: present region: us-east-1 @@ -326,7 +326,7 @@ delegate_to: localhost # Create an ELB and add tags -- elb_classic_lb: +- community.aws.elb_classic_lb: name: "New ELB" state: present region: us-east-1 @@ -344,7 +344,7 @@ delegate_to: localhost # Delete all tags from an ELB -- elb_classic_lb: +- community.aws.elb_classic_lb: name: "New ELB" state: present region: us-east-1 diff --git a/plugins/modules/elb_classic_lb_info.py b/plugins/modules/elb_classic_lb_info.py index 8708aa95b32..2b90a7141a1 100644 --- a/plugins/modules/elb_classic_lb_info.py +++ b/plugins/modules/elb_classic_lb_info.py @@ -47,10 +47,10 @@ EXAMPLES = ''' # Note: These examples do not set authentication details, see the AWS Guide for details. -# Output format tries to match ec2_elb_lb module input parameters +# Output format tries to match amazon.aws.ec2_elb_lb module input parameters # Gather information about all ELBs -- elb_classic_lb_info: +- community.aws.elb_classic_lb_info: register: elb_info - debug: @@ -58,7 +58,7 @@ loop: "{{ elb_info.elbs }}" # Gather information about a particular ELB -- elb_classic_lb_info: +- community.aws.elb_classic_lb_info: names: frontend-prod-elb register: elb_info @@ -66,7 +66,7 @@ msg: "{{ elb_info.elbs.0.dns_name }}" # Gather information about a set of ELBs -- elb_classic_lb_info: +- community.aws.elb_classic_lb_info: names: - frontend-prod-elb - backend-prod-elb diff --git a/plugins/modules/elb_instance.py b/plugins/modules/elb_instance.py index 9bd2560a93a..de8290cec7c 100644 --- a/plugins/modules/elb_instance.py +++ b/plugins/modules/elb_instance.py @@ -69,10 +69,8 @@ EXAMPLES = """ # basic pre_task and post_task example pre_tasks: - - name: Gathering ec2 facts - action: ec2_facts - name: Instance De-register - elb_instance: + community.aws.elb_instance: instance_id: "{{ ansible_ec2_instance_id }}" state: absent delegate_to: localhost @@ -80,7 +78,7 @@ - myrole post_tasks: - name: Instance Register - elb_instance: + community.aws.elb_instance: instance_id: "{{ ansible_ec2_instance_id }}" ec2_elbs: "{{ item }}" state: present diff --git a/plugins/modules/elb_network_lb.py b/plugins/modules/elb_network_lb.py index 8e4e40c60c8..2ba66f2151f 100644 --- a/plugins/modules/elb_network_lb.py +++ b/plugins/modules/elb_network_lb.py @@ -138,8 +138,8 @@ EXAMPLES = ''' # Note: These examples do not set authentication details, see the AWS Guide for details. -# Create an ELB and attach a listener -- elb_network_lb: +- name: Create an ELB and attach a listener + community.aws.elb_network_lb: name: myelb subnets: - subnet-012345678 @@ -152,8 +152,8 @@ TargetGroupName: mytargetgroup # Required. The name of the target group state: present -# Create an ELB with an attached Elastic IP address -- elb_network_lb: +- name: Create an ELB with an attached Elastic IP address + community.aws.elb_network_lb: name: myelb subnet_mappings: - SubnetId: subnet-012345678 @@ -166,8 +166,8 @@ TargetGroupName: mytargetgroup # Required. The name of the target group state: present -# Remove an ELB -- elb_network_lb: +- name: Remove an ELB + community.aws.elb_network_lb: name: myelb state: absent diff --git a/plugins/modules/elb_target.py b/plugins/modules/elb_target.py index 438c51e7392..70187f696ca 100644 --- a/plugins/modules/elb_target.py +++ b/plugins/modules/elb_target.py @@ -78,27 +78,27 @@ EXAMPLES = ''' # Note: These examples do not set authentication details, see the AWS Guide for details. -# Register an IP address target to a target group -- elb_target: +- name: Register an IP address target to a target group + community.aws.elb_target: target_group_name: myiptargetgroup target_id: i-1234567 state: present -# Register an instance target to a target group -- elb_target: +- name: Register an instance target to a target group + community.aws.elb_target: target_group_name: mytargetgroup target_id: i-1234567 state: present -# Deregister a target from a target group -- elb_target: +- name: Deregister a target from a target group + community.aws.elb_target: target_group_name: mytargetgroup target_id: i-1234567 state: absent # Modify a target to use a different port -# Register a target to a target group -- elb_target: +- name: Register a target to a target group + community.aws.elb_target: target_group_name: mytargetgroup target_id: i-1234567 target_port: 8080 diff --git a/plugins/modules/elb_target_group.py b/plugins/modules/elb_target_group.py index 34cbd3828c5..c0304ed0196 100644 --- a/plugins/modules/elb_target_group.py +++ b/plugins/modules/elb_target_group.py @@ -172,16 +172,16 @@ EXAMPLES = ''' # Note: These examples do not set authentication details, see the AWS Guide for details. -# Create a target group with a default health check -- elb_target_group: +- name: Create a target group with a default health check + community.aws.elb_target_group: name: mytargetgroup protocol: http port: 80 vpc_id: vpc-01234567 state: present -# Modify the target group with a custom health check -- elb_target_group: +- name: Modify the target group with a custom health check + community.aws.elb_target_group: name: mytargetgroup protocol: http port: 80 @@ -196,13 +196,13 @@ unhealthy_threshold_count: 3 state: present -# Delete a target group -- elb_target_group: +- name: Delete a target group + community.aws.elb_target_group: name: mytargetgroup state: absent -# Create a target group with instance targets -- elb_target_group: +- name: Create a target group with instance targets + community.aws.elb_target_group: name: mytargetgroup protocol: http port: 81 @@ -219,8 +219,8 @@ wait_timeout: 200 wait: True -# Create a target group with IP address targets -- elb_target_group: +- name: Create a target group with IP address targets + community.aws.elb_target_group: name: mytargetgroup protocol: http port: 81 @@ -243,10 +243,10 @@ # itself is allow to invoke the lambda function. # therefore you need first to create an empty target group # to receive its arn, second, allow the target group -# to invoke the lamba function and third, add the target +# to invoke the lambda function and third, add the target # to the target group - name: first, create empty target group - elb_target_group: + community.aws.elb_target_group: name: my-lambda-targetgroup target_type: lambda state: present @@ -254,7 +254,7 @@ register: out - name: second, allow invoke of the lambda - lambda_policy: + community.aws.lambda_policy: state: "{{ state | default('present') }}" function_name: my-lambda-function statement_id: someID @@ -263,7 +263,7 @@ source_arn: "{{ out.target_group_arn }}" - name: third, add target - elb_target_group: + community.aws.elb_target_group: name: my-lambda-targetgroup target_type: lambda state: present diff --git a/plugins/modules/elb_target_group_info.py b/plugins/modules/elb_target_group_info.py index 6c3e335d485..183f0d25030 100644 --- a/plugins/modules/elb_target_group_info.py +++ b/plugins/modules/elb_target_group_info.py @@ -51,15 +51,15 @@ EXAMPLES = ''' # Note: These examples do not set authentication details, see the AWS Guide for details. -# Gather information about all target groups -- elb_target_group_info: +- name: Gather information about all target groups + community.aws.elb_target_group_info: -# Gather information about the target group attached to a particular ELB -- elb_target_group_info: +- name: Gather information about the target group attached to a particular ELB + community.aws.elb_target_group_info: load_balancer_arn: "arn:aws:elasticloadbalancing:ap-southeast-2:001122334455:loadbalancer/app/my-elb/aabbccddeeff" -# Gather information about a target groups named 'tg1' and 'tg2' -- elb_target_group_info: +- name: Gather information about a target groups named 'tg1' and 'tg2' + community.aws.elb_target_group_info: names: - tg1 - tg2 diff --git a/plugins/modules/elb_target_info.py b/plugins/modules/elb_target_info.py index 15ca68338ff..718dcbe4a7d 100644 --- a/plugins/modules/elb_target_info.py +++ b/plugins/modules/elb_target_info.py @@ -40,14 +40,14 @@ ''' EXAMPLES = """ -# practical use case - dynamically deregistering and reregistering nodes +# practical use case - dynamically de-registering and re-registering nodes - name: Get EC2 Metadata - action: ec2_metadata_facts + amazon.aws.ec2_metadata_facts: - name: Get initial list of target groups delegate_to: localhost - elb_target_info: + community.aws.elb_target_info: instance_id: "{{ ansible_ec2_instance_id }}" region: "{{ ansible_ec2_placement_region }}" register: target_info @@ -58,7 +58,7 @@ - name: Deregister instance from all target groups delegate_to: localhost - elb_target: + community.aws.elb_target: target_group_arn: "{{ item.0.target_group_arn }}" target_port: "{{ item.1.target_port }}" target_az: "{{ item.1.target_az }}" @@ -76,7 +76,7 @@ - name: wait for all targets to deregister simultaneously delegate_to: localhost - elb_target_info: + community.aws.elb_target_info: get_unused_target_groups: false instance_id: "{{ ansible_ec2_instance_id }}" region: "{{ ansible_ec2_placement_region }}" @@ -86,7 +86,7 @@ delay: 10 - name: reregister in elbv2s - elb_target: + community.aws.elb_target: region: "{{ ansible_ec2_placement_region }}" target_group_arn: "{{ item.0.target_group_arn }}" target_port: "{{ item.1.target_port }}" @@ -101,7 +101,7 @@ # wait until all groups associated with this instance are 'healthy' or # 'unused' - name: wait for registration - elb_target_info: + community.aws.elb_target_info: get_unused_target_groups: false instance_id: "{{ ansible_ec2_instance_id }}" region: "{{ ansible_ec2_placement_region }}" diff --git a/plugins/modules/execute_lambda.py b/plugins/modules/execute_lambda.py index 901b83bafc5..f7645d66764 100644 --- a/plugins/modules/execute_lambda.py +++ b/plugins/modules/execute_lambda.py @@ -78,7 +78,7 @@ ''' EXAMPLES = ''' -- execute_lambda: +- community.aws.execute_lambda: name: test-function # the payload is automatically serialized and sent to the function payload: @@ -88,11 +88,11 @@ # Test that you have sufficient permissions to execute a Lambda function in # another account -- execute_lambda: +- community.aws.execute_lambda: function_arn: arn:aws:lambda:us-east-1:123456789012:function/some-function dry_run: true -- execute_lambda: +- community.aws.execute_lambda: name: test-function payload: foo: bar @@ -103,12 +103,12 @@ # the response will have a `logs` key that will contain a log (up to 4KB) of the function execution in Lambda # Pass the Lambda event payload as a json file. -- execute_lambda: +- community.aws.execute_lambda: name: test-function payload: "{{ lookup('file','lambda_event.json') }}" register: response -- execute_lambda: +- community.aws.execute_lambda: name: test-function version_qualifier: PRODUCTION ''' diff --git a/plugins/modules/iam.py b/plugins/modules/iam.py index e195a4a9adb..760fa165a9a 100644 --- a/plugins/modules/iam.py +++ b/plugins/modules/iam.py @@ -104,9 +104,8 @@ EXAMPLES = ''' # Basic user creation example -tasks: - name: Create two new IAM users with API keys - iam: + community.aws.iam: iam_type: user name: "{{ item }}" state: present @@ -118,9 +117,8 @@ # Advanced example, create two new groups and add the pre-existing user # jdavila to both groups. -task: - name: Create Two Groups, Mario and Luigi - iam: + community.aws.iam: iam_type: group name: "{{ item }}" state: present @@ -129,8 +127,8 @@ - Luigi register: new_groups -- name: - iam: +- name: Update user + community.aws.iam: iam_type: user name: jdavila state: update @@ -139,7 +137,7 @@ # Example of role with custom trust policy for Lambda service - name: Create IAM role with custom trust relationship - iam: + community.aws.iam: iam_type: role name: AAALambdaTestRole state: present diff --git a/plugins/modules/iam_cert.py b/plugins/modules/iam_cert.py index c48b122dbd9..f226c618f11 100644 --- a/plugins/modules/iam_cert.py +++ b/plugins/modules/iam_cert.py @@ -87,24 +87,24 @@ ''' EXAMPLES = ''' -# Basic server certificate upload from local file -- iam_cert: +- name: Basic server certificate upload from local file + community.aws.iam_cert: name: very_ssl state: present cert: "{{ lookup('file', 'path/to/cert') }}" key: "{{ lookup('file', 'path/to/key') }}" cert_chain: "{{ lookup('file', 'path/to/certchain') }}" -# Basic server certificate upload -- iam_cert: +- name: Basic server certificate upload + community.aws.iam_cert: name: very_ssl state: present cert: path/to/cert key: path/to/key cert_chain: path/to/certchain -# Server certificate upload using key string -- iam_cert: +- name: Server certificate upload using key string + community.aws.iam_cert: name: very_ssl state: present path: "/a/cert/path/" @@ -112,8 +112,8 @@ key: vault_body_of_privcertkey cert_chain: body_of_myverytrustedchain -# Basic rename of existing certificate -- iam_cert: +- name: Basic rename of existing certificate + community.aws.iam_cert: name: very_ssl new_name: new_very_ssl state: present diff --git a/plugins/modules/iam_group.py b/plugins/modules/iam_group.py index cfac6062c46..5f6f043f2e6 100644 --- a/plugins/modules/iam_group.py +++ b/plugins/modules/iam_group.py @@ -39,7 +39,7 @@ managed_policies: description: - A list of managed policy ARNs or friendly names to attach to the role. - - To embed an inline policy, use M(iam_policy). + - To embed an inline policy, use M(community.aws.iam_policy). required: false type: list elements: str @@ -79,20 +79,20 @@ EXAMPLES = ''' # Note: These examples do not set authentication details, see the AWS Guide for details. -# Create a group -- iam_group: +- name: Create a group + community.aws.iam_group: name: testgroup1 state: present -# Create a group and attach a managed policy using its ARN -- iam_group: +- name: Create a group and attach a managed policy using its ARN + community.aws.iam_group: name: testgroup1 managed_policies: - arn:aws:iam::aws:policy/AmazonSNSFullAccess state: present -# Create a group with users as members and attach a managed policy using its ARN -- iam_group: +- name: Create a group with users as members and attach a managed policy using its ARN + community.aws.iam_group: name: testgroup1 managed_policies: - arn:aws:iam::aws:policy/AmazonSNSFullAccess @@ -101,23 +101,22 @@ - test_user2 state: present -# Remove all managed policies from an existing group with an empty list -- iam_group: +- name: Remove all managed policies from an existing group with an empty list + community.aws.iam_group: name: testgroup1 state: present purge_policies: true -# Remove all group members from an existing group -- iam_group: +- name: Remove all group members from an existing group + community.aws.iam_group: name: testgroup1 managed_policies: - arn:aws:iam::aws:policy/AmazonSNSFullAccess purge_users: true state: present - -# Delete the group -- iam_group: +- name: Delete the group + community.aws.iam_group: name: testgroup1 state: absent diff --git a/plugins/modules/iam_managed_policy.py b/plugins/modules/iam_managed_policy.py index 435d2dcf800..bdc8d470cb7 100644 --- a/plugins/modules/iam_managed_policy.py +++ b/plugins/modules/iam_managed_policy.py @@ -65,7 +65,7 @@ EXAMPLES = ''' # Create Policy ex nihilo - name: Create IAM Managed Policy - iam_managed_policy: + community.aws.iam_managed_policy: policy_name: "ManagedPolicy" policy_description: "A Helpful managed policy" policy: "{{ lookup('template', 'managed_policy.json.j2') }}" @@ -73,14 +73,14 @@ # Update a policy with a new default version - name: Create IAM Managed Policy - iam_managed_policy: + community.aws.iam_managed_policy: policy_name: "ManagedPolicy" policy: "{{ lookup('file', 'managed_policy_update.json') }}" state: present # Update a policy with a new non default version - name: Create IAM Managed Policy - iam_managed_policy: + community.aws.iam_managed_policy: policy_name: "ManagedPolicy" policy: "{{ lookup('file', 'managed_policy_update.json') }}" make_default: false @@ -88,7 +88,7 @@ # Update a policy and make it the only version and the default version - name: Create IAM Managed Policy - iam_managed_policy: + community.aws.iam_managed_policy: policy_name: "ManagedPolicy" policy: "{ 'Version': '2012-10-17', 'Statement':[{'Effect': 'Allow','Action': '*','Resource': '*'}]}" only_version: true @@ -96,7 +96,7 @@ # Remove a policy - name: Create IAM Managed Policy - iam_managed_policy: + community.aws.iam_managed_policy: policy_name: "ManagedPolicy" state: absent ''' diff --git a/plugins/modules/iam_mfa_device_info.py b/plugins/modules/iam_mfa_device_info.py index 12dae087a70..a2d8afe750b 100644 --- a/plugins/modules/iam_mfa_device_info.py +++ b/plugins/modules/iam_mfa_device_info.py @@ -50,12 +50,12 @@ EXAMPLES = ''' # Note: These examples do not set authentication details, see the AWS Guide for details. -# List MFA devices (more details: https://docs.aws.amazon.com/IAM/latest/APIReference/API_ListMFADevices.html) -- iam_mfa_device_info: +- name: List MFA devices (more details: https://docs.aws.amazon.com/IAM/latest/APIReference/API_ListMFADevices.html) + community.aws.iam_mfa_device_info: register: mfa_devices -# Assume an existing role (more details: https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html) -- sts_assume_role: +- name: Assume an existing role (more details: https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html) + community.aws.sts_assume_role: mfa_serial_number: "{{ mfa_devices.mfa_devices[0].serial_number }}" role_arn: "arn:aws:iam::123456789012:role/someRole" role_session_name: "someRoleSession" diff --git a/plugins/modules/iam_password_policy.py b/plugins/modules/iam_password_policy.py index ead34bf8868..eaa134bb3dd 100644 --- a/plugins/modules/iam_password_policy.py +++ b/plugins/modules/iam_password_policy.py @@ -87,7 +87,7 @@ EXAMPLES = ''' - name: Password policy for AWS account - iam_password_policy: + community.aws.iam_password_policy: state: present min_pw_length: 8 require_symbols: false diff --git a/plugins/modules/iam_policy.py b/plugins/modules/iam_policy.py index 87c7895bfb8..40c1e080447 100644 --- a/plugins/modules/iam_policy.py +++ b/plugins/modules/iam_policy.py @@ -15,8 +15,8 @@ short_description: Manage inline IAM policies for users, groups, and roles description: - Allows uploading or removing inline IAM policies for IAM users, groups or roles. - - To administer managed policies please see M(iam_user), M(iam_role), - M(iam_group) and M(iam_managed_policy) + - To administer managed policies please see M(community.aws.iam_user), M(community.aws.iam_role), + M(community.aws.iam_group) and M(community.aws.iam_managed_policy) options: iam_type: description: @@ -73,7 +73,7 @@ EXAMPLES = ''' # Create a policy with the name of 'Admin' to the group 'administrators' - name: Assign a policy called Admin to the administrators group - iam_policy: + community.aws.iam_policy: iam_type: group iam_name: administrators policy_name: Admin @@ -83,7 +83,7 @@ # Advanced example, create two new groups and add a READ-ONLY policy to both # groups. - name: Create Two Groups, Mario and Luigi - iam: + community.aws.iam: iam_type: group name: "{{ item }}" state: present @@ -93,7 +93,7 @@ register: new_groups - name: Apply READ-ONLY policy to new groups that have been recently created - iam_policy: + community.aws.iam_policy: iam_type: group iam_name: "{{ item.created_group.group_name }}" policy_name: "READ-ONLY" @@ -103,7 +103,7 @@ # Create a new S3 policy with prefix per user - name: Create S3 policy from template - iam_policy: + community.aws.iam_policy: iam_type: user iam_name: "{{ item.user }}" policy_name: "s3_limited_access_{{ item.prefix }}" diff --git a/plugins/modules/iam_policy_info.py b/plugins/modules/iam_policy_info.py index b80428938f1..842c871e5f5 100644 --- a/plugins/modules/iam_policy_info.py +++ b/plugins/modules/iam_policy_info.py @@ -44,13 +44,13 @@ ''' EXAMPLES = ''' -# Describe all inline IAM policies on an IAM User -- iam_policy_info: +- name: Describe all inline IAM policies on an IAM User + community.aws.iam_policy_info: iam_type: user iam_name: example_user -# Describe a specific inline policy on an IAM Role -- iam_policy_info: +- name: Describe a specific inline policy on an IAM Role + community.aws.iam_policy_info: iam_type: role iam_name: example_role policy_name: example_policy diff --git a/plugins/modules/iam_role.py b/plugins/modules/iam_role.py index fafa00541dc..2a272b13f97 100644 --- a/plugins/modules/iam_role.py +++ b/plugins/modules/iam_role.py @@ -49,7 +49,7 @@ description: - A list of managed policy ARNs or, since Ansible 2.4, a list of either managed policy ARNs or friendly names. - To remove all policies set I(purge_polices=true) and I(managed_policies=[None]). - - To embed an inline policy, use M(iam_policy). + - To embed an inline policy, use M(community.aws.iam_policy). aliases: ['managed_policy'] type: list max_session_duration: @@ -102,7 +102,7 @@ # Note: These examples do not set authentication details, see the AWS Guide for details. - name: Create a role with description and tags - iam_role: + community.aws.iam_role: name: mynewrole assume_role_policy_document: "{{ lookup('file','policy.json') }}" description: This is My New Role @@ -110,20 +110,20 @@ env: dev - name: "Create a role and attach a managed policy called 'PowerUserAccess'" - iam_role: + community.aws.iam_role: name: mynewrole assume_role_policy_document: "{{ lookup('file','policy.json') }}" managed_policies: - arn:aws:iam::aws:policy/PowerUserAccess - name: Keep the role created above but remove all managed policies - iam_role: + community.aws.iam_role: name: mynewrole assume_role_policy_document: "{{ lookup('file','policy.json') }}" managed_policies: [] - name: Delete the role - iam_role: + community.aws.iam_role: name: mynewrole assume_role_policy_document: "{{ lookup('file', 'policy.json') }}" state: absent diff --git a/plugins/modules/iam_role_info.py b/plugins/modules/iam_role_info.py index 9912cfdaa20..a0309a2e2a0 100644 --- a/plugins/modules/iam_role_info.py +++ b/plugins/modules/iam_role_info.py @@ -41,16 +41,16 @@ ''' EXAMPLES = ''' -# find all existing IAM roles -- iam_role_info: +- name: find all existing IAM roles + community.aws.iam_role_info: register: result -# describe a single role -- iam_role_info: +- name: describe a single role + community.aws.iam_role_info: name: MyIAMRole -# describe all roles matching a path prefix -- iam_role_info: +- name: describe all roles matching a path prefix + community.aws.iam_role_info: path_prefix: /application/path ''' diff --git a/plugins/modules/iam_saml_federation.py b/plugins/modules/iam_saml_federation.py index 0d6f3e3f474..9204b4b97ed 100644 --- a/plugins/modules/iam_saml_federation.py +++ b/plugins/modules/iam_saml_federation.py @@ -60,7 +60,7 @@ # It is assumed that their matching environment variables are set. # Creates a new iam saml identity provider if not present - name: saml provider - iam_saml_federation: + community.aws.iam_saml_federation: name: example1 # the > below opens an indented block, so no escaping/quoting is needed when in the indentation level under this key saml_metadata_document: > @@ -68,13 +68,13 @@ /home/ubuntu/test.txt" register: my_instance -# Delete an instance -- lightsail: +- name: Delete an instance + community.aws.lightsail: state: absent region: us-east-1 name: my_instance diff --git a/plugins/modules/rds.py b/plugins/modules/rds.py index 1ac4a1b15ad..702915e5b1c 100644 --- a/plugins/modules/rds.py +++ b/plugins/modules/rds.py @@ -20,7 +20,7 @@ - When creating an instance it can be either a new instance or a read-only replica of an existing instance. - This module has a dependency on python-boto >= 2.5 and will soon be deprecated. - The 'promote' command requires boto >= 2.18.0. Certain features such as tags rely on boto.rds2 (boto >= 2.26.0). - - Please use boto3 based M(rds_instance) instead. + - Please use boto3 based M(community.aws.rds_instance) instead. options: command: description: @@ -240,8 +240,8 @@ # FIXME: the command stuff needs a 'state' like alias to make things consistent -- MPD EXAMPLES = ''' -# Basic mysql provisioning example -- rds: +- name: Basic mysql provisioning example + community.aws.rds: command: create instance_name: new-database db_engine: MySQL @@ -253,35 +253,35 @@ Environment: testing Application: cms -# Create a read-only replica and wait for it to become available -- rds: +- name: Create a read-only replica and wait for it to become available + community.aws.rds: command: replicate instance_name: new-database-replica source_instance: new_database wait: yes wait_timeout: 600 -# Delete an instance, but create a snapshot before doing so -- rds: +- name: Delete an instance, but create a snapshot before doing so + community.aws.rds: command: delete instance_name: new-database snapshot: new_database_snapshot -# Get facts about an instance -- rds: +- name: Get facts about an instance + community.aws.rds: command: facts instance_name: new-database register: new_database_facts -# Rename an instance and wait for the change to take effect -- rds: +- name: Rename an instance and wait for the change to take effect + community.aws.rds: command: modify instance_name: new-database new_instance_name: renamed-database wait: yes -# Reboot an instance and wait for it to become available again -- rds: +- name: Reboot an instance and wait for it to become available again + community.aws.rds: command: reboot instance_name: database wait: yes @@ -289,27 +289,25 @@ # Restore a Postgres db instance from a snapshot, wait for it to become available again, and # then modify it to add your security group. Also, display the new endpoint. # Note that the "publicly_accessible" option is allowed here just as it is in the AWS CLI -- local_action: - module: rds - command: restore - snapshot: mypostgres-snapshot - instance_name: MyNewInstanceName - region: us-west-2 - zone: us-west-2b - subnet: default-vpc-xx441xxx - publicly_accessible: yes - wait: yes - wait_timeout: 600 - tags: - Name: pg1_test_name_tag +- community.aws.rds: + command: restore + snapshot: mypostgres-snapshot + instance_name: MyNewInstanceName + region: us-west-2 + zone: us-west-2b + subnet: default-vpc-xx441xxx + publicly_accessible: yes + wait: yes + wait_timeout: 600 + tags: + Name: pg1_test_name_tag register: rds -- local_action: - module: rds - command: modify - instance_name: MyNewInstanceName - region: us-west-2 - vpc_security_groups: sg-xxx945xx +- community.aws.rds: + command: modify + instance_name: MyNewInstanceName + region: us-west-2 + vpc_security_groups: sg-xxx945xx - debug: msg: "The new db endpoint is {{ rds.instance.endpoint }}" diff --git a/plugins/modules/rds_instance.py b/plugins/modules/rds_instance.py index c0deddd89e3..fb7da17d197 100644 --- a/plugins/modules/rds_instance.py +++ b/plugins/modules/rds_instance.py @@ -421,7 +421,7 @@ EXAMPLES = ''' # Note: These examples do not set authentication details, see the AWS Guide for details. - name: create minimal aurora instance in default VPC and default subnet group - rds_instance: + community.aws.rds_instance: engine: aurora db_instance_identifier: ansible-test-aurora-db-instance instance_type: db.t2.small @@ -430,7 +430,7 @@ cluster_id: ansible-test-cluster # This cluster must exist - see rds_cluster to manage it - name: Create a DB instance using the default AWS KMS encryption key - rds_instance: + community.aws.rds_instance: id: test-encrypted-db state: present engine: mariadb @@ -441,13 +441,13 @@ allocated_storage: "{{ allocated_storage }}" - name: remove the DB instance without a final snapshot - rds_instance: + community.aws.rds_instance: id: "{{ instance_id }}" state: absent skip_final_snapshot: True - name: remove the DB instance with a final snapshot - rds_instance: + community.aws.rds_instance: id: "{{ instance_id }}" state: absent final_snapshot_identifier: "{{ snapshot_id }}" diff --git a/plugins/modules/rds_instance_info.py b/plugins/modules/rds_instance_info.py index cc8535d5628..ffc1a71ef32 100644 --- a/plugins/modules/rds_instance_info.py +++ b/plugins/modules/rds_instance_info.py @@ -45,13 +45,13 @@ ''' EXAMPLES = ''' -# Get information about an instance -- rds_instance_info: +- name: Get information about an instance + community.aws.rds_instance_info: db_instance_identifier: new-database register: new_database_info -# Get all RDS instances -- rds_instance_info: +- name: Get all RDS instances + community.aws.rds_instance_info: ''' RETURN = ''' diff --git a/plugins/modules/rds_param_group.py b/plugins/modules/rds_param_group.py index bdaf7fe4e7d..a787c3c11ad 100644 --- a/plugins/modules/rds_param_group.py +++ b/plugins/modules/rds_param_group.py @@ -72,8 +72,8 @@ ''' EXAMPLES = ''' -# Add or change a parameter group, in this case setting auto_increment_increment to 42 * 1024 -- rds_param_group: +- name: Add or change a parameter group, in this case setting auto_increment_increment to 42 * 1024 + community.aws.rds_param_group: state: present name: norwegian-blue description: 'My Fancy Ex Parrot Group' @@ -84,8 +84,8 @@ Environment: production Application: parrot -# Remove a parameter group -- rds_param_group: +- name: Remove a parameter group + community.aws.rds_param_group: state: absent name: norwegian-blue ''' diff --git a/plugins/modules/rds_snapshot.py b/plugins/modules/rds_snapshot.py index c00d21064f8..72aec9e8fda 100644 --- a/plugins/modules/rds_snapshot.py +++ b/plugins/modules/rds_snapshot.py @@ -71,13 +71,13 @@ ''' EXAMPLES = ''' -# Create snapshot -- rds_snapshot: +- name: Create snapshot + community.aws.rds_snapshot: db_instance_identifier: new-database db_snapshot_identifier: new-database-snapshot -# Delete snapshot -- rds_snapshot: +- name: Delete snapshot + community.aws.rds_snapshot: db_snapshot_identifier: new-database-snapshot state: absent ''' diff --git a/plugins/modules/rds_snapshot_info.py b/plugins/modules/rds_snapshot_info.py index e887c3dd933..febdb5b7205 100644 --- a/plugins/modules/rds_snapshot_info.py +++ b/plugins/modules/rds_snapshot_info.py @@ -66,13 +66,13 @@ ''' EXAMPLES = ''' -# Get information about an snapshot -- rds_snapshot_info: +- name: Get information about an snapshot + community.aws.rds_snapshot_info: db_snapshot_identifier: snapshot_name register: new_database_info -# Get all RDS snapshots for an RDS instance -- rds_snapshot_info: +- name: Get all RDS snapshots for an RDS instance + community.aws.rds_snapshot_info: db_instance_identifier: helloworld-rds-master ''' diff --git a/plugins/modules/rds_subnet_group.py b/plugins/modules/rds_subnet_group.py index b0fb417a28f..3d37c7884b2 100644 --- a/plugins/modules/rds_subnet_group.py +++ b/plugins/modules/rds_subnet_group.py @@ -47,8 +47,8 @@ ''' EXAMPLES = ''' -# Add or change a subnet group -- rds_subnet_group: +- name: Add or change a subnet group + community.aws.rds_subnet_group: state: present name: norwegian-blue description: My Fancy Ex Parrot Subnet Group @@ -56,8 +56,8 @@ - subnet-aaaaaaaa - subnet-bbbbbbbb -# Remove a subnet group -- rds_subnet_group: +- name: Remove a subnet group + community.aws.rds_subnet_group: state: absent name: norwegian-blue ''' diff --git a/plugins/modules/redshift.py b/plugins/modules/redshift.py index 997240aaf68..46595098f7e 100644 --- a/plugins/modules/redshift.py +++ b/plugins/modules/redshift.py @@ -178,16 +178,16 @@ ''' EXAMPLES = ''' -# Basic cluster provisioning example -- redshift: > - command=create - node_type=ds1.xlarge - identifier=new_cluster - username=cluster_admin - password=1nsecure - -# Cluster delete example -- redshift: +- name: Basic cluster provisioning example + community.aws.redshift: + command: create + node_type: ds1.xlarge + identifier: new_cluster + username: cluster_admin + password: 1nsecure + +- name: Cluster delete example + community.aws.redshift: command: delete identifier: new_cluster skip_final_cluster_snapshot: true diff --git a/plugins/modules/redshift_cross_region_snapshots.py b/plugins/modules/redshift_cross_region_snapshots.py index cd7a7c0d744..36e2c06f31e 100644 --- a/plugins/modules/redshift_cross_region_snapshots.py +++ b/plugins/modules/redshift_cross_region_snapshots.py @@ -65,7 +65,7 @@ EXAMPLES = ''' - name: configure cross-region snapshot on cluster `johniscool` - redshift_cross_region_snapshots: + community.aws.redshift_cross_region_snapshots: cluster_name: johniscool state: present region: us-east-1 @@ -73,7 +73,7 @@ retention_period: 1 - name: configure cross-region snapshot on kms-encrypted cluster - redshift_cross_region_snapshots: + community.aws.redshift_cross_region_snapshots: cluster_name: whatever state: present region: us-east-1 @@ -82,7 +82,7 @@ retention_period: 10 - name: disable cross-region snapshots, necessary before most cluster modifications (rename, resize) - redshift_cross_region_snapshots: + community.aws.redshift_cross_region_snapshots: cluster_name: whatever state: absent region: us-east-1 diff --git a/plugins/modules/redshift_info.py b/plugins/modules/redshift_info.py index 98dd0090c94..6adf350a3e6 100644 --- a/plugins/modules/redshift_info.py +++ b/plugins/modules/redshift_info.py @@ -43,27 +43,27 @@ EXAMPLES = ''' # Note: These examples do net set authentication details, see the AWS guide for details. -# Find all clusters -- redshift_info: +- name: Find all clusters + community.aws.redshift_info: register: redshift -# Find cluster(s) with matching tags -- redshift_info: +- name: Find cluster(s) with matching tags + community.aws.redshift_info: tags: env: prd stack: monitoring register: redshift_tags -# Find cluster(s) with matching name/prefix and tags -- redshift_info: +- name: Find cluster(s) with matching name/prefix and tags + community.aws.redshift_info: tags: env: dev stack: web name: user- register: redshift_web -# Fail if no cluster(s) is/are found -- redshift_info: +- name: Fail if no cluster(s) is/are found + community.aws.redshift_info: tags: env: stg stack: db diff --git a/plugins/modules/redshift_subnet_group.py b/plugins/modules/redshift_subnet_group.py index f09c028988f..23c25a52864 100644 --- a/plugins/modules/redshift_subnet_group.py +++ b/plugins/modules/redshift_subnet_group.py @@ -52,9 +52,8 @@ ''' EXAMPLES = ''' -# Create a Redshift subnet group -- local_action: - module: redshift_subnet_group +- name: Create a Redshift subnet group + community.aws.redshift_subnet_group: state: present group_name: redshift-subnet group_description: Redshift subnet @@ -62,8 +61,8 @@ - 'subnet-aaaaa' - 'subnet-bbbbb' -# Remove subnet group -- redshift_subnet_group: +- name: Remove subnet group + community.aws.redshift_subnet_group: state: absent group_name: redshift-subnet ''' diff --git a/plugins/modules/route53.py b/plugins/modules/route53.py index 3347f51aaca..6db1cbc1e78 100644 --- a/plugins/modules/route53.py +++ b/plugins/modules/route53.py @@ -218,107 +218,109 @@ ''' EXAMPLES = ''' -# Add new.foo.com as an A record with 3 IPs and wait until the changes have been replicated -- route53: - state: present - zone: foo.com - record: new.foo.com - type: A - ttl: 7200 - value: 1.1.1.1,2.2.2.2,3.3.3.3 - wait: yes - -# Update new.foo.com as an A record with a list of 3 IPs and wait until the changes have been replicated -- route53: - state: present - zone: foo.com - record: new.foo.com - type: A - ttl: 7200 - value: - - 1.1.1.1 - - 2.2.2.2 - - 3.3.3.3 - wait: yes - -# Retrieve the details for new.foo.com -- route53: - state: get - zone: foo.com - record: new.foo.com - type: A +- name: Add new.foo.com as an A record with 3 IPs and wait until the changes have been replicated + community.aws.route53: + state: present + zone: foo.com + record: new.foo.com + type: A + ttl: 7200 + value: 1.1.1.1,2.2.2.2,3.3.3.3 + wait: yes + +- name: Update new.foo.com as an A record with a list of 3 IPs and wait until the changes have been replicated + community.aws.route53: + state: present + zone: foo.com + record: new.foo.com + type: A + ttl: 7200 + value: + - 1.1.1.1 + - 2.2.2.2 + - 3.3.3.3 + wait: yes + +- name: Retrieve the details for new.foo.com + community.aws.route53: + state: get + zone: foo.com + record: new.foo.com + type: A register: rec -# Delete new.foo.com A record using the results from the get command -- route53: - state: absent - zone: foo.com - record: "{{ rec.set.record }}" - ttl: "{{ rec.set.ttl }}" - type: "{{ rec.set.type }}" - value: "{{ rec.set.value }}" +- name: Delete new.foo.com A record using the results from the get command + community.aws.route53: + state: absent + zone: foo.com + record: "{{ rec.set.record }}" + ttl: "{{ rec.set.ttl }}" + type: "{{ rec.set.type }}" + value: "{{ rec.set.value }}" # Add an AAAA record. Note that because there are colons in the value # that the IPv6 address must be quoted. Also shows using the old form command=create. -- route53: - command: create - zone: foo.com - record: localhost.foo.com - type: AAAA - ttl: 7200 - value: "::1" - -# Add a SRV record with multiple fields for a service on port 22222 +- name: Add an AAAA record + community.aws.route53: + command: create + zone: foo.com + record: localhost.foo.com + type: AAAA + ttl: 7200 + value: "::1" + # For more information on SRV records see: # https://en.wikipedia.org/wiki/SRV_record -- route53: - state: present - zone: foo.com - record: "_example-service._tcp.foo.com" - type: SRV - value: "0 0 22222 host1.foo.com,0 0 22222 host2.foo.com" - -# Add a TXT record. Note that TXT and SPF records must be surrounded +- name: Add a SRV record with multiple fields for a service on port 22222 + community.aws.route53: + state: present + zone: foo.com + record: "_example-service._tcp.foo.com" + type: SRV + value: "0 0 22222 host1.foo.com,0 0 22222 host2.foo.com" + +# Note that TXT and SPF records must be surrounded # by quotes when sent to Route 53: -- route53: - state: present - zone: foo.com - record: localhost.foo.com - type: TXT - ttl: 7200 - value: '"bar"' - -# Add an alias record that points to an Amazon ELB: -- route53: - state: present - zone: foo.com - record: elb.foo.com - type: A - value: "{{ elb_dns_name }}" - alias: True - alias_hosted_zone_id: "{{ elb_zone_id }}" - -# Retrieve the details for elb.foo.com -- route53: - state: get - zone: foo.com - record: elb.foo.com - type: A +- name: Add a TXT record. + community.aws.route53: + state: present + zone: foo.com + record: localhost.foo.com + type: TXT + ttl: 7200 + value: '"bar"' + +- name: Add an alias record that points to an Amazon ELB: + community.aws.route53: + state: present + zone: foo.com + record: elb.foo.com + type: A + value: "{{ elb_dns_name }}" + alias: True + alias_hosted_zone_id: "{{ elb_zone_id }}" + +- name: Retrieve the details for elb.foo.com + community.aws.route53: + state: get + zone: foo.com + record: elb.foo.com + type: A register: rec -# Delete an alias record using the results from the get command -- route53: - state: absent - zone: foo.com - record: "{{ rec.set.record }}" - ttl: "{{ rec.set.ttl }}" - type: "{{ rec.set.type }}" - value: "{{ rec.set.value }}" - alias: True - alias_hosted_zone_id: "{{ rec.set.alias_hosted_zone_id }}" - -# Add an alias record that points to an Amazon ELB and evaluates it health: -- route53: +- name: Delete an alias record using the results from the get command + community.aws.route53: + state: absent + zone: foo.com + record: "{{ rec.set.record }}" + ttl: "{{ rec.set.ttl }}" + type: "{{ rec.set.type }}" + value: "{{ rec.set.value }}" + alias: True + alias_hosted_zone_id: "{{ rec.set.alias_hosted_zone_id }}" + +- name: Add an alias record that points to an Amazon ELB and evaluates it health: + community.aws.route53: state: present zone: foo.com record: elb.foo.com @@ -328,39 +330,39 @@ alias_hosted_zone_id: "{{ elb_zone_id }}" alias_evaluate_target_health: True -# Add an AAAA record with Hosted Zone ID. -- route53: - state: present - zone: foo.com - hosted_zone_id: Z2AABBCCDDEEFF - record: localhost.foo.com - type: AAAA - ttl: 7200 - value: "::1" - -# Use a routing policy to distribute traffic: -- route53: - state: present - zone: foo.com - record: www.foo.com - type: CNAME - value: host1.foo.com - ttl: 30 - # Routing policy - identifier: "host1@www" - weight: 100 - health_check: "d994b780-3150-49fd-9205-356abdd42e75" - -# Add a CAA record (RFC 6844): -- route53: - state: present - zone: example.com - record: example.com - type: CAA - value: - - 0 issue "ca.example.net" - - 0 issuewild ";" - - 0 iodef "mailto:security@example.com" +- name: Add an AAAA record with Hosted Zone ID. + community.aws.route53: + state: present + zone: foo.com + hosted_zone_id: Z2AABBCCDDEEFF + record: localhost.foo.com + type: AAAA + ttl: 7200 + value: "::1" + +- name: Use a routing policy to distribute traffic: + community.aws.route53: + state: present + zone: foo.com + record: www.foo.com + type: CNAME + value: host1.foo.com + ttl: 30 + # Routing policy + identifier: "host1@www" + weight: 100 + health_check: "d994b780-3150-49fd-9205-356abdd42e75" + +- name: Add a CAA record (RFC 6844): + community.aws.route53: + state: present + zone: example.com + record: example.com + type: CAA + value: + - 0 issue "ca.example.net" + - 0 issuewild ";" + - 0 iodef "mailto:security@example.com" ''' diff --git a/plugins/modules/route53_health_check.py b/plugins/modules/route53_health_check.py index c974c72a5f1..6fe4df6f654 100644 --- a/plugins/modules/route53_health_check.py +++ b/plugins/modules/route53_health_check.py @@ -89,8 +89,8 @@ ''' EXAMPLES = ''' -# Create a health-check for host1.example.com and use it in record -- route53_health_check: +- name: Create a health-check for host1.example.com and use it in record + community.aws.route53_health_check: state: present fqdn: host1.example.com type: HTTP_STR_MATCH @@ -100,7 +100,7 @@ failure_threshold: 2 register: my_health_check -- route53: +- community.aws.route53: action: create zone: "example.com" type: CNAME @@ -112,8 +112,8 @@ weight: 100 health_check: "{{ my_health_check.health_check.id }}" -# Delete health-check -- route53_health_check: +- name: Delete health-check + community.aws.route53_health_check: state: absent fqdn: host1.example.com diff --git a/plugins/modules/route53_info.py b/plugins/modules/route53_info.py index d3d2f3abae9..e851a1e96aa 100644 --- a/plugins/modules/route53_info.py +++ b/plugins/modules/route53_info.py @@ -141,19 +141,19 @@ EXAMPLES = ''' # Simple example of listing all hosted zones - name: List all hosted zones - route53_info: + community.aws.route53_info: query: hosted_zone register: hosted_zones # Getting a count of hosted zones - name: Return a count of all hosted zones - route53_info: + community.aws.route53_info: query: hosted_zone hosted_zone_method: count register: hosted_zone_count - name: List the first 20 resource record sets in a given hosted zone - route53_info: + community.aws.route53_info: profile: account_name query: record_sets hosted_zone_id: ZZZ1111112222 @@ -161,33 +161,33 @@ register: record_sets - name: List first 20 health checks - route53_info: + community.aws.route53_info: query: health_check health_check_method: list max_items: 20 register: health_checks - name: Get health check last failure_reason - route53_info: + community.aws.route53_info: query: health_check health_check_method: failure_reason health_check_id: 00000000-1111-2222-3333-12345678abcd register: health_check_failure_reason - name: Retrieve reusable delegation set details - route53_info: + community.aws.route53_info: query: reusable_delegation_set delegation_set_id: delegation id register: delegation_sets - name: setup of example for using next_marker - route53_info: + community.aws.route53_info: query: hosted_zone max_items: 1 register: first_info - name: example for using next_marker - route53_info: + community.aws.route53_info: query: hosted_zone next_marker: "{{ first_info.NextMarker }}" max_items: 1 @@ -196,12 +196,12 @@ - name: retrieve host entries starting with host1.workshop.test.io block: - name: grab zone id - route53_zone: + community.aws.route53_zone: zone: "test.io" register: AWSINFO - name: grab Route53 record information - route53_info: + community.aws.route53_info: type: A query: record_sets hosted_zone_id: "{{ AWSINFO.zone_id }}" diff --git a/plugins/modules/route53_zone.py b/plugins/modules/route53_zone.py index 698ef524996..cfbdb4ee52b 100644 --- a/plugins/modules/route53_zone.py +++ b/plugins/modules/route53_zone.py @@ -61,24 +61,24 @@ EXAMPLES = ''' - name: create a public zone - route53_zone: + community.aws.route53_zone: zone: example.com comment: this is an example - name: delete a public zone - route53_zone: + community.aws.route53_zone: zone: example.com state: absent - name: create a private zone - route53_zone: + community.aws.route53_zone: zone: devel.example.com vpc_id: '{{ myvpc_id }}' vpc_region: us-west-2 comment: developer domain - name: create a public zone associated with a specific reusable delegation set - route53_zone: + community.aws.route53_zone: zone: example.com comment: reusable delegation set example delegation_set_id: A1BCDEF2GHIJKL diff --git a/plugins/modules/s3_bucket_notification.py b/plugins/modules/s3_bucket_notification.py index d61ca14e143..c275fc7bc2d 100644 --- a/plugins/modules/s3_bucket_notification.py +++ b/plugins/modules/s3_bucket_notification.py @@ -17,10 +17,10 @@ short_description: Creates, updates or deletes S3 Bucket notification for lambda description: - This module allows the management of AWS Lambda function bucket event mappings via the - Ansible framework. Use module M(lambda) to manage the lambda function itself, M(lambda_alias) - to manage function aliases and M(lambda_policy) to modify lambda permissions. + Ansible framework. Use module M(community.aws.lambda) to manage the lambda function itself, M(community.aws.lambda_alias) + to manage function aliases and M(community.aws.lambda_policy) to modify lambda permissions. notes: - - This module heavily depends on M(lambda_policy) as you need to allow C(lambda:InvokeFunction) + - This module heavily depends on M(community.aws.lambda_policy) as you need to allow C(lambda:InvokeFunction) permission for your lambda function. author: @@ -95,18 +95,15 @@ EXAMPLES = ''' --- # Example that creates a lambda event notification for a bucket -- hosts: localhost - gather_facts: no - tasks: - - name: Process jpg image - s3_bucket_notification: - state: present - event_name: on_file_add_or_remove - bucket_name: test-bucket - function_name: arn:aws:lambda:us-east-2:526810320200:function:test-lambda - events: ["s3:ObjectCreated:*", "s3:ObjectRemoved:*"] - prefix: images/ - suffix: .jpg +- name: Process jpg image + community.aws.s3_bucket_notification: + state: present + event_name: on_file_add_or_remove + bucket_name: test-bucket + function_name: arn:aws:lambda:us-east-2:526810320200:function:test-lambda + events: ["s3:ObjectCreated:*", "s3:ObjectRemoved:*"] + prefix: images/ + suffix: .jpg ''' RETURN = ''' diff --git a/plugins/modules/s3_lifecycle.py b/plugins/modules/s3_lifecycle.py index e8fb62c0814..2675a296153 100644 --- a/plugins/modules/s3_lifecycle.py +++ b/plugins/modules/s3_lifecycle.py @@ -131,16 +131,16 @@ EXAMPLES = ''' # Note: These examples do not set authentication details, see the AWS Guide for details. -# Configure a lifecycle rule on a bucket to expire (delete) items with a prefix of /logs/ after 30 days -- s3_lifecycle: +- name: Configure a lifecycle rule on a bucket to expire (delete) items with a prefix of /logs/ after 30 days + community.aws.s3_lifecycle: name: mybucket expiration_days: 30 prefix: logs/ status: enabled state: present -# Configure a lifecycle rule to transition all items with a prefix of /logs/ to glacier after 7 days and then delete after 90 days -- s3_lifecycle: +- name: Configure a lifecycle rule to transition all items with a prefix of /logs/ to glacier after 7 days and then delete after 90 days + community.aws.s3_lifecycle: name: mybucket transition_days: 7 expiration_days: 90 @@ -148,10 +148,10 @@ status: enabled state: present -# Configure a lifecycle rule to transition all items with a prefix of /logs/ to glacier on 31 Dec 2020 and then delete on 31 Dec 2030. # Note that midnight GMT must be specified. # Be sure to quote your date strings -- s3_lifecycle: +- name: Configure a lifecycle rule to transition all items with a prefix of /logs/ to glacier on 31 Dec 2020 and then delete on 31 Dec 2030. + community.aws.s3_lifecycle: name: mybucket transition_date: "2020-12-30T00:00:00.000Z" expiration_date: "2030-12-30T00:00:00.000Z" @@ -159,21 +159,21 @@ status: enabled state: present -# Disable the rule created above -- s3_lifecycle: +- name: Disable the rule created above + community.aws.s3_lifecycle: name: mybucket prefix: logs/ status: disabled state: present -# Delete the lifecycle rule created above -- s3_lifecycle: +- name: Delete the lifecycle rule created above + community.aws.s3_lifecycle: name: mybucket prefix: logs/ state: absent -# Configure a lifecycle rule to transition all backup files older than 31 days in /backups/ to standard infrequent access class. -- s3_lifecycle: +- name: Configure a lifecycle rule to transition all backup files older than 31 days in /backups/ to standard infrequent access class. + community.aws.s3_lifecycle: name: mybucket prefix: backups/ storage_class: standard_ia @@ -181,8 +181,8 @@ state: present status: enabled -# Configure a lifecycle rule to transition files to infrequent access after 30 days and glacier after 90 -- s3_lifecycle: +- name: Configure a lifecycle rule to transition files to infrequent access after 30 days and glacier after 90 + community.aws.s3_lifecycle: name: mybucket prefix: logs/ state: present diff --git a/plugins/modules/s3_logging.py b/plugins/modules/s3_logging.py index b13e5eea086..362636ec5f8 100644 --- a/plugins/modules/s3_logging.py +++ b/plugins/modules/s3_logging.py @@ -49,14 +49,14 @@ # Note: These examples do not set authentication details, see the AWS Guide for details. - name: Enable logging of s3 bucket mywebsite.com to s3 bucket mylogs - s3_logging: + community.aws.s3_logging: name: mywebsite.com target_bucket: mylogs target_prefix: logs/mywebsite.com state: present - name: Remove logging on an s3 bucket - s3_logging: + community.aws.s3_logging: name: mywebsite.com state: absent diff --git a/plugins/modules/s3_sync.py b/plugins/modules/s3_sync.py index 1123aea9a06..cd7a0d85229 100644 --- a/plugins/modules/s3_sync.py +++ b/plugins/modules/s3_sync.py @@ -130,12 +130,12 @@ EXAMPLES = ''' - name: basic upload - s3_sync: + community.aws.s3_sync: bucket: tedder file_root: roles/s3/files/ - name: all the options - s3_sync: + community.aws.s3_sync: bucket: tedder file_root: roles/s3/files mime_map: diff --git a/plugins/modules/s3_website.py b/plugins/modules/s3_website.py index 1c87ed73ba8..31c0ee515c6 100644 --- a/plugins/modules/s3_website.py +++ b/plugins/modules/s3_website.py @@ -57,19 +57,19 @@ EXAMPLES = ''' # Note: These examples do not set authentication details, see the AWS Guide for details. -# Configure an s3 bucket to redirect all requests to example.com -- s3_website: +- name: Configure an s3 bucket to redirect all requests to example.com + community.aws.s3_website: name: mybucket.com redirect_all_requests: example.com state: present -# Remove website configuration from an s3 bucket -- s3_website: +- name: Remove website configuration from an s3 bucket + community.aws.s3_website: name: mybucket.com state: absent -# Configure an s3 bucket as a website with index and error pages -- s3_website: +- name: Configure an s3 bucket as a website with index and error pages + community.aws.s3_website: name: mybucket.com suffix: home.htm error_key: errors/404.htm diff --git a/plugins/modules/sns.py b/plugins/modules/sns.py index 97f202fdc19..fa9601ee665 100644 --- a/plugins/modules/sns.py +++ b/plugins/modules/sns.py @@ -93,14 +93,14 @@ EXAMPLES = """ - name: Send default notification message via SNS - sns: + community.aws.sns: msg: '{{ inventory_hostname }} has completed the play.' subject: Deploy complete! topic: deploy delegate_to: localhost - name: Send notification messages via SNS with short message for SMS - sns: + community.aws.sns: msg: '{{ inventory_hostname }} has completed the play.' sms: deployed! subject: Deploy complete! @@ -108,7 +108,7 @@ delegate_to: localhost - name: Send message with message_attributes - sns: + community.aws.sns: topic: "deploy" msg: "message with extra details!" message_attributes: diff --git a/plugins/modules/sns_topic.py b/plugins/modules/sns_topic.py index 141906edb18..bd8b5f726b4 100644 --- a/plugins/modules/sns_topic.py +++ b/plugins/modules/sns_topic.py @@ -16,7 +16,7 @@ module: sns_topic short_description: Manages AWS SNS topics and subscriptions description: - - The M(sns_topic) module allows you to create, delete, and manage subscriptions for AWS SNS topics. + - The M(community.aws.sns_topic) module allows you to create, delete, and manage subscriptions for AWS SNS topics. - As of 2.6, this module can be use to subscribe and unsubscribe to topics outside of your AWS account. author: - "Joel Thompson (@joelthompson)" @@ -80,7 +80,7 @@ EXAMPLES = """ - name: Create alarm SNS topic - sns_topic: + community.aws.sns_topic: name: "alarms" state: present display_name: "alarm SNS topic" @@ -109,7 +109,7 @@ type: str returned: always sample: "arn:aws:sns:us-east-2:111111111111:my_topic_name" -sns_topic: +community.aws.sns_topic: description: Dict of sns topic details type: complex returned: always diff --git a/plugins/modules/sqs_queue.py b/plugins/modules/sqs_queue.py index ca8041f11f8..5c92dece6c2 100644 --- a/plugins/modules/sqs_queue.py +++ b/plugins/modules/sqs_queue.py @@ -174,8 +174,8 @@ ''' EXAMPLES = ''' -# Create SQS queue with redrive policy -- sqs_queue: +- name: Create SQS queue with redrive policy + community.aws.sqs_queue: name: my-queue region: ap-southeast-2 default_visibility_timeout: 120 @@ -188,35 +188,35 @@ maxReceiveCount: 5 deadLetterTargetArn: arn:aws:sqs:eu-west-1:123456789012:my-dead-queue -# Drop redrive policy -- sqs_queue: +- name: Drop redrive policy + community.aws.sqs_queue: name: my-queue region: ap-southeast-2 redrive_policy: {} -# Create FIFO queue -- sqs_queue: +- name: Create FIFO queue + community.aws.sqs_queue: name: fifo-queue region: ap-southeast-2 queue_type: fifo content_based_deduplication: yes -# Tag queue -- sqs_queue: +- name: Tag queue + community.aws.sqs_queue: name: fifo-queue region: ap-southeast-2 tags: example: SomeValue -# Configure Encryption, automatically uses a new data key every hour -- sqs_queue: +- name: Configure Encryption, automatically uses a new data key every hour + community.aws.sqs_queue: name: fifo-queue region: ap-southeast-2 kms_master_key_id: alias/MyQueueKey kms_data_key_reuse_period_seconds: 3600 -# Delete SQS queue -- sqs_queue: +- name: Delete SQS queue + community.aws.sqs_queue: name: my-queue region: ap-southeast-2 state: absent diff --git a/plugins/modules/sts_assume_role.py b/plugins/modules/sts_assume_role.py index 7f86c34a475..b01b3139494 100644 --- a/plugins/modules/sts_assume_role.py +++ b/plugins/modules/sts_assume_role.py @@ -93,13 +93,13 @@ # Note: These examples do not set authentication details, see the AWS Guide for details. # Assume an existing role (more details: https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html) -- sts_assume_role: +- community.aws.sts_assume_role: role_arn: "arn:aws:iam::123456789012:role/someRole" role_session_name: "someRoleSession" register: assumed_role # Use the assumed role above to tag an instance in account 123456789012 -- ec2_tag: +- amazon.aws.ec2_tag: aws_access_key: "{{ assumed_role.sts_creds.access_key }}" aws_secret_key: "{{ assumed_role.sts_creds.secret_key }}" security_token: "{{ assumed_role.sts_creds.session_token }}" diff --git a/plugins/modules/sts_session_token.py b/plugins/modules/sts_session_token.py index e83d71ffd69..9713750b72a 100644 --- a/plugins/modules/sts_session_token.py +++ b/plugins/modules/sts_session_token.py @@ -65,20 +65,21 @@ EXAMPLES = ''' # Note: These examples do not set authentication details, see the AWS Guide for details. -# Get a session token (more details: https://docs.aws.amazon.com/STS/latest/APIReference/API_GetSessionToken.html) -sts_session_token: - duration_seconds: 3600 -register: session_credentials - -# Use the session token obtained above to tag an instance in account 123456789012 -ec2_tag: - aws_access_key: "{{ session_credentials.sts_creds.access_key }}" - aws_secret_key: "{{ session_credentials.sts_creds.secret_key }}" - security_token: "{{ session_credentials.sts_creds.session_token }}" - resource: i-xyzxyz01 - state: present - tags: - MyNewTag: value +# (more details: https://docs.aws.amazon.com/STS/latest/APIReference/API_GetSessionToken.html) +- name: Get a session token + community.aws.sts_session_token: + duration_seconds: 3600 + register: session_credentials + +- name: Use the session token obtained above to tag an instance in account 123456789012 + amazon.aws.ec2_tag: + aws_access_key: "{{ session_credentials.sts_creds.access_key }}" + aws_secret_key: "{{ session_credentials.sts_creds.secret_key }}" + security_token: "{{ session_credentials.sts_creds.session_token }}" + resource: i-xyzxyz01 + state: present + tags: + MyNewTag: value '''