diff --git a/plugins/modules/aws_acm.py b/plugins/modules/aws_acm.py index 93034e7e71f..de20833ac03 100644 --- a/plugins/modules/aws_acm.py +++ b/plugins/modules/aws_acm.py @@ -157,14 +157,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 @@ -178,19 +178,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 ac11eb696a8..dfbd955a178 100644 --- a/plugins/modules/aws_acm_info.py +++ b/plugins/modules/aws_acm_info.py @@ -50,19 +50,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 @@ -70,7 +70,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 1a508299e06..49b1a1f8a4e 100644 --- a/plugins/modules/aws_api_gateway.py +++ b/plugins/modules/aws_api_gateway.py @@ -116,7 +116,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 @@ -126,7 +126,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. @@ -136,7 +136,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 51d98743da3..369302d7a9b 100644 --- a/plugins/modules/aws_application_scaling_policy.py +++ b/plugins/modules/aws_application_scaling_policy.py @@ -111,7 +111,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 @@ -132,7 +132,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 @@ -150,7 +150,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 38a22ca69cd..04738ffefae 100644 --- a/plugins/modules/aws_batch_compute_environment.py +++ b/plugins/modules/aws_batch_compute_environment.py @@ -12,8 +12,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) @@ -131,7 +131,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 6f385ef20fc..7debf759156 100644 --- a/plugins/modules/aws_batch_job_definition.py +++ b/plugins/modules/aws_batch_job_definition.py @@ -12,8 +12,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) @@ -185,7 +185,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 c888b560e0b..3ca0333b940 100644 --- a/plugins/modules/aws_batch_job_queue.py +++ b/plugins/modules/aws_batch_job_queue.py @@ -12,8 +12,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) @@ -75,7 +75,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 ca79d056bce..8b4a7bf04c4 100644 --- a/plugins/modules/aws_codebuild.py +++ b/plugins/modules/aws_codebuild.py @@ -165,7 +165,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 dc7bbaee160..8f26be4ed48 100644 --- a/plugins/modules/aws_codecommit.py +++ b/plugins/modules/aws_codecommit.py @@ -126,12 +126,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 1784d7859c4..90fea4016cd 100644 --- a/plugins/modules/aws_codepipeline.py +++ b/plugins/modules/aws_codepipeline.py @@ -82,7 +82,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 d2057a18591..a29eda64394 100644 --- a/plugins/modules/aws_config_aggregation_authorization.py +++ b/plugins/modules/aws_config_aggregation_authorization.py @@ -41,12 +41,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 7b97fded3c9..5976c9058fb 100644 --- a/plugins/modules/aws_config_aggregator.py +++ b/plugins/modules/aws_config_aggregator.py @@ -76,7 +76,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 f0fda8e61f4..afaef581de7 100644 --- a/plugins/modules/aws_config_delivery_channel.py +++ b/plugins/modules/aws_config_delivery_channel.py @@ -54,7 +54,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 970e6f8c0bc..7b576b6cda7 100644 --- a/plugins/modules/aws_config_recorder.py +++ b/plugins/modules/aws_config_recorder.py @@ -67,7 +67,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 9ce254def76..50c8d82c552 100644 --- a/plugins/modules/aws_config_rule.py +++ b/plugins/modules/aws_config_rule.py @@ -91,7 +91,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 0b2f16ea083..61a0caf0149 100644 --- a/plugins/modules/aws_direct_connect_connection.py +++ b/plugins/modules/aws_direct_connect_connection.py @@ -71,7 +71,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 @@ -80,14 +80,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 @@ -95,7 +95,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 7fa8ca23740..1524e17fd7a 100644 --- a/plugins/modules/aws_direct_connect_gateway.py +++ b/plugins/modules/aws_direct_connect_gateway.py @@ -55,7 +55,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 @@ -63,7 +63,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 92e8433f5ed..30b0656af5f 100644 --- a/plugins/modules/aws_direct_connect_link_aggregation_group.py +++ b/plugins/modules/aws_direct_connect_link_aggregation_group.py @@ -82,7 +82,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 3883d12331b..6450be0ab08 100644 --- a/plugins/modules/aws_direct_connect_virtual_interface.py +++ b/plugins/modules/aws_direct_connect_virtual_interface.py @@ -219,14 +219,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 6cb7d4fe0ce..27200f55908 100644 --- a/plugins/modules/aws_eks_cluster.py +++ b/plugins/modules/aws_eks_cluster.py @@ -65,7 +65,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 @@ -77,7 +77,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 88c6b58d4af..67f5bc611a8 100644 --- a/plugins/modules/aws_elasticbeanstalk_app.py +++ b/plugins/modules/aws_elasticbeanstalk_app.py @@ -48,13 +48,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 d2dec7b8db8..1810a6df2e9 100644 --- a/plugins/modules/aws_glue_connection.py +++ b/plugins/modules/aws_glue_connection.py @@ -70,7 +70,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 @@ -79,7 +79,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 7a9d76d0890..966029ce325 100644 --- a/plugins/modules/aws_glue_job.py +++ b/plugins/modules/aws_glue_job.py @@ -84,14 +84,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 00d5ac35ba1..d7e668038fd 100644 --- a/plugins/modules/aws_inspector_target.py +++ b/plugins/modules/aws_inspector_target.py @@ -45,20 +45,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 7722a4803f8..0a0bba626e6 100644 --- a/plugins/modules/aws_kms.py +++ b/plugins/modules/aws_kms.py @@ -17,7 +17,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. @@ -177,28 +177,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 @@ -208,7 +208,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 @@ -222,13 +222,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 4424e8fe2ce..1f6f9f394e3 100644 --- a/plugins/modules/aws_kms_info.py +++ b/plugins/modules/aws_kms_info.py @@ -36,15 +36,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 cafb743ece1..719cce0cec8 100644 --- a/plugins/modules/aws_region_info.py +++ b/plugins/modules/aws_region_info.py @@ -33,10 +33,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 30964ab1c5a..7b250f89ed6 100644 --- a/plugins/modules/aws_s3_bucket_info.py +++ b/plugins/modules/aws_s3_bucket_info.py @@ -16,7 +16,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 @@ -30,7 +30,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 7a63596e6ab..130b20966e2 100644 --- a/plugins/modules/aws_s3_cors.py +++ b/plugins/modules/aws_s3_cors.py @@ -40,7 +40,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: @@ -57,7 +57,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 0f4a8e78c9f..a007cf564f5 100644 --- a/plugins/modules/aws_secret.py +++ b/plugins/modules/aws_secret.py @@ -76,14 +76,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 81a80630f97..2185d07d0e8 100644 --- a/plugins/modules/aws_ses_identity.py +++ b/plugins/modules/aws_ses_identity.py @@ -95,31 +95,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: @@ -133,14 +133,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 a657a1a4175..bb166523585 100644 --- a/plugins/modules/aws_ses_identity_policy.py +++ b/plugins/modules/aws_ses_identity_policy.py @@ -46,28 +46,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 d351f2b8d26..b6b45afce75 100644 --- a/plugins/modules/aws_ses_rule_set.py +++ b/plugins/modules/aws_ses_rule_set.py @@ -11,7 +11,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)" @@ -54,29 +54,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 5cfc7ab8cc0..7963e11bfc0 100644 --- a/plugins/modules/aws_sgw_info.py +++ b/plugins/modules/aws_sgw_info.py @@ -165,10 +165,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 7e9cb76e897..c721fe3385d 100644 --- a/plugins/modules/aws_ssm_parameter_store.py +++ b/plugins/modules/aws_ssm_parameter_store.py @@ -77,25 +77,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" @@ -103,7 +103,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" @@ -111,7 +111,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 a5261e593da..a283a57ce6d 100644 --- a/plugins/modules/aws_step_functions_state_machine.py +++ b/plugins/modules/aws_step_functions_state_machine.py @@ -66,7 +66,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 @@ -75,7 +75,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 @@ -84,7 +84,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 b64efacbaf7..65ed30453c7 100644 --- a/plugins/modules/aws_step_functions_state_machine_execution.py +++ b/plugins/modules/aws_step_functions_state_machine_execution.py @@ -56,13 +56,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 bab1f97772e..df6632ce1d6 100644 --- a/plugins/modules/aws_waf_condition.py +++ b/plugins/modules/aws_waf_condition.py @@ -138,7 +138,7 @@ EXAMPLES = ''' - name: create WAF byte condition - aws_waf_condition: + community.aws.aws_waf_condition: name: my_byte_condition filters: - field_to_match: header @@ -148,7 +148,7 @@ type: byte - name: create WAF geo condition - aws_waf_condition: + community.aws.aws_waf_condition: name: my_geo_condition filters: - country: US @@ -157,7 +157,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" @@ -165,7 +165,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 @@ -178,7 +178,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 @@ -187,7 +187,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 @@ -195,7 +195,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 76fe5d084a7..9a895c847ea 100644 --- a/plugins/modules/aws_waf_info.py +++ b/plugins/modules/aws_waf_info.py @@ -35,14 +35,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 5d1c8d3667b..54fb1b23f8b 100644 --- a/plugins/modules/aws_waf_rule.py +++ b/plugins/modules/aws_waf_rule.py @@ -42,7 +42,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 @@ -75,7 +75,7 @@ EXAMPLES = ''' - name: create WAF rule - aws_waf_rule: + community.aws.aws_waf_rule: name: my_waf_rule conditions: - name: my_regex_condition @@ -89,7 +89,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 22da20a7692..fe954dda1b2 100644 --- a/plugins/modules/aws_waf_web_acl.py +++ b/plugins/modules/aws_waf_web_acl.py @@ -85,7 +85,7 @@ EXAMPLES = ''' - name: create web ACL - aws_waf_web_acl: + community.aws.aws_waf_web_acl: name: my_web_acl rules: - name: my_rule @@ -96,7 +96,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 50f4f847af5..2c6166dc0d5 100644 --- a/plugins/modules/cloudformation_exports_info.py +++ b/plugins/modules/cloudformation_exports_info.py @@ -22,7 +22,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 69f53669f51..a7b476d032e 100644 --- a/plugins/modules/cloudformation_stack_set.py +++ b/plugins/modules/cloudformation_stack_set.py @@ -13,7 +13,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: @@ -177,7 +177,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 @@ -187,7 +187,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: @@ -200,7 +200,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 6597d37bbef..26237ea1851 100644 --- a/plugins/modules/cloudfront_distribution.py +++ b/plugins/modules/cloudfront_distribution.py @@ -580,11 +580,9 @@ ''' -EXAMPLES = ''' - -# create a basic distribution with defaults and tags - -- cloudfront_distribution: +EXAMPLES = r''' +- 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: @@ -592,31 +590,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 @@ -624,9 +618,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 @@ -636,9 +629,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: @@ -674,9 +666,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 46aa714dbf2..a5bcb4ca572 100644 --- a/plugins/modules/cloudfront_info.py +++ b/plugins/modules/cloudfront_info.py @@ -13,7 +13,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 @@ -152,21 +152,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 @@ -176,36 +176,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 fe84099931d..13a7d8c30b3 100644 --- a/plugins/modules/cloudfront_invalidation.py +++ b/plugins/modules/cloudfront_invalidation.py @@ -60,7 +60,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: @@ -69,7 +69,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 fd66d587ab2..17bfb6a71d1 100644 --- a/plugins/modules/cloudfront_origin_access_identity.py +++ b/plugins/modules/cloudfront_origin_access_identity.py @@ -62,19 +62,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 c4a5f2e6e74..83e6cc0b0f1 100644 --- a/plugins/modules/cloudtrail.py +++ b/plugins/modules/cloudtrail.py @@ -105,7 +105,7 @@ EXAMPLES = ''' - name: create single region cloudtrail - cloudtrail: + community.aws.cloudtrail: state: present name: default s3_bucket_name: mylogbucket @@ -113,7 +113,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 @@ -128,7 +128,7 @@ Name: default - name: show another valid kms_key_id - cloudtrail: + community.aws.cloudtrail: state: present name: default s3_bucket_name: mylogbucket @@ -136,7 +136,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 @@ -149,7 +149,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 23f3efa7aec..29854fcc10b 100644 --- a/plugins/modules/cloudwatchevent_rule.py +++ b/plugins/modules/cloudwatchevent_rule.py @@ -107,7 +107,7 @@ ''' EXAMPLES = ''' -- cloudwatchevent_rule: +- community.aws.cloudwatchevent_rule: name: MyCronTask schedule_expression: "cron(0 20 * * ? *)" description: Run my scheduled task @@ -115,7 +115,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 @@ -125,7 +125,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 54687816f03..c2f10956f34 100644 --- a/plugins/modules/cloudwatchlogs_log_group.py +++ b/plugins/modules/cloudwatchlogs_log_group.py @@ -71,21 +71,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 448bb954d40..f1b87c8d52d 100644 --- a/plugins/modules/cloudwatchlogs_log_group_info.py +++ b/plugins/modules/cloudwatchlogs_log_group_info.py @@ -30,7 +30,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 fd2c9221eff..b606a9ef8a9 100644 --- a/plugins/modules/cloudwatchlogs_log_group_metric_filter.py +++ b/plugins/modules/cloudwatchlogs_log_group_metric_filter.py @@ -13,7 +13,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 @@ -67,7 +67,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")}' @@ -78,7 +78,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 9f9ef5d818b..f52cf3f842e 100644 --- a/plugins/modules/data_pipeline.py +++ b/plugins/modules/data_pipeline.py @@ -131,7 +131,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}}" @@ -143,7 +143,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" @@ -166,13 +166,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 1fea45a4a04..7fc1a253a9f 100644 --- a/plugins/modules/dms_endpoint.py +++ b/plugins/modules/dms_endpoint.py @@ -149,8 +149,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 @@ -165,7 +165,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 9cb0caf060f..9354eeabc86 100644 --- a/plugins/modules/dms_replication_subnet_group.py +++ b/plugins/modules/dms_replication_subnet_group.py @@ -48,7 +48,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 1edf139dbfa..ee5cd8470c0 100644 --- a/plugins/modules/dynamodb_table.py +++ b/plugins/modules/dynamodb_table.py @@ -121,8 +121,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 @@ -134,15 +134,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: @@ -156,8 +156,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 654b311c72a..dbf7bcfc53c 100644 --- a/plugins/modules/dynamodb_ttl.py +++ b/plugins/modules/dynamodb_ttl.py @@ -42,13 +42,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 974993a42ed..c6a1bb0ee45 100644 --- a/plugins/modules/ec2_ami_copy.py +++ b/plugins/modules/ec2_ami_copy.py @@ -75,14 +75,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 @@ -90,16 +90,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 @@ -108,15 +108,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 3f43193f102..3bfd6f131a9 100644 --- a/plugins/modules/ec2_asg.py +++ b/plugins/modules/ec2_asg.py @@ -12,7 +12,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: @@ -45,7 +45,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: @@ -243,7 +243,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' ] @@ -269,7 +269,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 @@ -278,7 +278,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 @@ -292,7 +292,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 @@ -307,7 +307,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' ] @@ -325,7 +325,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 4c523db50de..2cce6380fd6 100644 --- a/plugins/modules/ec2_asg_info.py +++ b/plugins/modules/ec2_asg_info.py @@ -38,37 +38,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 50e483d0ed1..9e01ca21aee 100644 --- a/plugins/modules/ec2_asg_lifecycle_hook.py +++ b/plugins/modules/ec2_asg_lifecycle_hook.py @@ -78,8 +78,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 @@ -88,8 +88,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 675e69a430f..8ac3f73d46a 100644 --- a/plugins/modules/ec2_customer_gateway.py +++ b/plugins/modules/ec2_customer_gateway.py @@ -54,17 +54,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 f37a0f35567..4872e691023 100644 --- a/plugins/modules/ec2_customer_gateway_info.py +++ b/plugins/modules/ec2_customer_gateway_info.py @@ -36,10 +36,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 @@ -47,7 +47,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 f4ba39f75a4..2859ccaee7f 100644 --- a/plugins/modules/ec2_eip.py +++ b/plugins/modules/ec2_eip.py @@ -99,39 +99,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 @@ -140,7 +140,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 @@ -150,12 +150,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 @@ -165,14 +165,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 @@ -180,13 +180,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 @@ -194,7 +194,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 61c3a49ad8a..4c2f8c6756d 100644 --- a/plugins/modules/ec2_eip_info.py +++ b/plugins/modules/ec2_eip_info.py @@ -29,38 +29,39 @@ ''' -EXAMPLES = ''' +EXAMPLES = r''' # 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 f820453a2d8..9ae1dc08b58 100644 --- a/plugins/modules/ec2_elb.py +++ b/plugins/modules/ec2_elb.py @@ -59,19 +59,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 215483a093f..bf753c2cbf6 100644 --- a/plugins/modules/ec2_elb_info.py +++ b/plugins/modules/ec2_elb_info.py @@ -40,38 +40,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 4238a7c15e7..8a682c56e12 100644 --- a/plugins/modules/ec2_instance.py +++ b/plugins/modules/ec2_instance.py @@ -14,7 +14,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) @@ -82,7 +82,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: @@ -117,14 +117,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: @@ -282,20 +282,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 @@ -307,8 +307,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 @@ -320,8 +320,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: @@ -335,8 +335,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 @@ -353,8 +353,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 @@ -370,8 +370,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 d2da8b96b6f..e94aaa74b21 100644 --- a/plugins/modules/ec2_instance_info.py +++ b/plugins/modules/ec2_instance_info.py @@ -41,26 +41,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 d80a226f155..5c1a993dd58 100644 --- a/plugins/modules/ec2_launch_template.py +++ b/plugins/modules/ec2_launch_template.py @@ -12,7 +12,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: @@ -219,7 +219,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. @@ -326,7 +326,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 @@ -337,13 +337,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 8e13c7ab13e..a8e6d87378a 100644 --- a/plugins/modules/ec2_lc.py +++ b/plugins/modules/ec2_lc.py @@ -194,7 +194,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 @@ -210,9 +210,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 @@ -224,9 +223,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 @@ -250,7 +248,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 043df722367..b1c457b945a 100644 --- a/plugins/modules/ec2_lc_find.py +++ b/plugins/modules/ec2_lc_find.py @@ -49,8 +49,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 5e032332af3..8e1cf258851 100644 --- a/plugins/modules/ec2_lc_info.py +++ b/plugins/modules/ec2_lc_info.py @@ -54,15 +54,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 debc170c123..42791c518bb 100644 --- a/plugins/modules/ec2_metric_alarm.py +++ b/plugins/modules/ec2_metric_alarm.py @@ -167,7 +167,7 @@ EXAMPLES = ''' - name: create alarm - ec2_metric_alarm: + community.aws.ec2_metric_alarm: state: present region: ap-southeast-2 name: "cpu-low" @@ -184,7 +184,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 4298c6522ec..b95069065aa 100644 --- a/plugins/modules/ec2_placement_group.py +++ b/plugins/modules/ec2_placement_group.py @@ -46,19 +46,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 33be33516d9..e9fa6338bad 100644 --- a/plugins/modules/ec2_placement_group_info.py +++ b/plugins/modules/ec2_placement_group_info.py @@ -29,22 +29,23 @@ ''' -EXAMPLES = ''' +EXAMPLES = r''' # 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 7beb95c0a0c..540b70527df 100644 --- a/plugins/modules/ec2_scaling_policy.py +++ b/plugins/modules/ec2_scaling_policy.py @@ -54,7 +54,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 38b22315a2f..68378d3b9c3 100644 --- a/plugins/modules/ec2_snapshot_copy.py +++ b/plugins/modules/ec2_snapshot_copy.py @@ -61,14 +61,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 @@ -76,23 +76,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 4f2f4dbd0c0..b75eb5510a4 100644 --- a/plugins/modules/ec2_transit_gateway.py +++ b/plugins/modules/ec2_transit_gateway.py @@ -89,14 +89,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 @@ -110,13 +110,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 d0f1409a2b5..7e5f69c5917 100644 --- a/plugins/modules/ec2_transit_gateway_info.py +++ b/plugins/modules/ec2_transit_gateway_info.py @@ -36,22 +36,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 9b4040484c3..e93ce7791e9 100644 --- a/plugins/modules/ec2_vpc_egress_igw.py +++ b/plugins/modules/ec2_vpc_egress_igw.py @@ -36,10 +36,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 1b89387bf36..7978c48dfde 100644 --- a/plugins/modules/ec2_vpc_endpoint.py +++ b/plugins/modules/ec2_vpc_endpoint.py @@ -22,7 +22,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 @@ -99,7 +99,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 @@ -111,7 +111,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 @@ -122,7 +122,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 @@ -134,7 +134,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 75ceb6b9bc7..0f23ca53217 100644 --- a/plugins/modules/ec2_vpc_endpoint_info.py +++ b/plugins/modules/ec2_vpc_endpoint_info.py @@ -43,19 +43,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: @@ -68,7 +68,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 0c85169c7d7..6b1a69911d4 100644 --- a/plugins/modules/ec2_vpc_igw.py +++ b/plugins/modules/ec2_vpc_igw.py @@ -44,10 +44,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 29845d2ccf5..dcc07a4349b 100644 --- a/plugins/modules/ec2_vpc_igw_info.py +++ b/plugins/modules/ec2_vpc_igw_info.py @@ -36,13 +36,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: @@ -50,7 +50,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 23130310720..5c14fec8040 100644 --- a/plugins/modules/ec2_vpc_nacl.py +++ b/plugins/modules/ec2_vpc_nacl.py @@ -86,7 +86,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 @@ -106,7 +106,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 @@ -120,20 +120,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 d4c0c431465..31b1099b04c 100644 --- a/plugins/modules/ec2_vpc_nacl_info.py +++ b/plugins/modules/ec2_vpc_nacl_info.py @@ -44,17 +44,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 d8ee5167b67..306c8ac49c4 100644 --- a/plugins/modules/ec2_vpc_nat_gateway.py +++ b/plugins/modules/ec2_vpc_nat_gateway.py @@ -84,7 +84,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 @@ -93,7 +93,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 @@ -101,7 +101,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 @@ -110,7 +110,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 @@ -118,7 +118,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 @@ -127,7 +127,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 @@ -137,7 +137,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 @@ -145,7 +145,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 85f96cc7340..83fb9b0f182 100644 --- a/plugins/modules/ec2_vpc_nat_gateway_info.py +++ b/plugins/modules/ec2_vpc_nat_gateway_info.py @@ -35,7 +35,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 @@ -44,7 +44,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 @@ -52,14 +52,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 c029eb5afa0..b8e263c1242 100644 --- a/plugins/modules/ec2_vpc_peer.py +++ b/plugins/modules/ec2_vpc_peer.py @@ -61,7 +61,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 @@ -73,7 +73,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 @@ -81,7 +81,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 @@ -93,7 +93,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 @@ -101,7 +101,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 @@ -114,7 +114,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 @@ -123,7 +123,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 @@ -136,7 +136,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 @@ -144,7 +144,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 @@ -156,14 +156,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 @@ -176,7 +176,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 @@ -188,7 +188,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 @@ -201,7 +201,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 75af1b65613..8472fc4f58c 100644 --- a/plugins/modules/ec2_vpc_peering_info.py +++ b/plugins/modules/ec2_vpc_peering_info.py @@ -35,7 +35,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 @@ -44,7 +44,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 @@ -52,7 +52,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 442efca01d7..0b8230ac7e1 100644 --- a/plugins/modules/ec2_vpc_route_table.py +++ b/plugins/modules/ec2_vpc_route_table.py @@ -85,7 +85,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: @@ -100,7 +100,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: @@ -115,7 +115,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 acb203f1eab..4823f2db49e 100644 --- a/plugins/modules/ec2_vpc_route_table_info.py +++ b/plugins/modules/ec2_vpc_route_table_info.py @@ -29,21 +29,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 004a64c394c..d1ea852d0e3 100644 --- a/plugins/modules/ec2_vpc_vgw.py +++ b/plugins/modules/ec2_vpc_vgw.py @@ -64,7 +64,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 @@ -74,7 +74,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 @@ -86,7 +86,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 @@ -95,7 +95,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 a8c8da426c9..d526b54a372 100644 --- a/plugins/modules/ec2_vpc_vgw_info.py +++ b/plugins/modules/ec2_vpc_vgw_info.py @@ -36,13 +36,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: @@ -50,7 +50,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 c344cc8e73e..4d0f06fb5a3 100644 --- a/plugins/modules/ec2_vpc_vpn.py +++ b/plugins/modules/ec2_vpc_vpn.py @@ -145,13 +145,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: @@ -159,12 +159,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 @@ -177,7 +177,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 @@ -189,7 +189,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 @@ -199,14 +199,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 427b4b8cec8..f34ddb8a937 100644 --- a/plugins/modules/ec2_vpc_vpn_info.py +++ b/plugins/modules/ec2_vpc_vpn_info.py @@ -37,16 +37,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 782ff16829c..9ae8cd52dc8 100644 --- a/plugins/modules/ec2_win_password.py +++ b/plugins/modules/ec2_win_password.py @@ -64,7 +64,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 @@ -72,7 +72,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 @@ -80,7 +80,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 @@ -89,7 +89,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 67b1664305e..37faa28ac03 100644 --- a/plugins/modules/ecs_attribute.py +++ b/plugins/modules/ecs_attribute.py @@ -62,8 +62,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 }}" @@ -72,8 +72,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 bf41601b011..3610dcc6a6e 100644 --- a/plugins/modules/ecs_cluster.py +++ b/plugins/modules/ecs_cluster.py @@ -50,18 +50,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 de9ab574fdb..23e1018c1f7 100644 --- a/plugins/modules/ecs_ecr.py +++ b/plugins/modules/ecs_ecr.py @@ -85,16 +85,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' @@ -109,22 +114,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: @@ -139,7 +144,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 7761d3d3a26..ddb2b8c1bba 100644 --- a/plugins/modules/ecs_service.py +++ b/plugins/modules/ecs_service.py @@ -195,7 +195,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 @@ -203,7 +203,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 @@ -217,13 +217,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 e7628d36881..9843f638d55 100644 --- a/plugins/modules/ecs_service_info.py +++ b/plugins/modules/ecs_service_info.py @@ -13,7 +13,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)" @@ -52,14 +52,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 fd49461fb07..a3c16d74681 100644 --- a/plugins/modules/ecs_tag.py +++ b/plugins/modules/ecs_tag.py @@ -59,7 +59,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 @@ -68,7 +68,7 @@ env: prod - name: Remove the Env tag - ecs_tag: + community.aws.ecs_tag: cluster_name: mycluster resource_type: cluster tags: @@ -76,7 +76,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: @@ -84,7 +84,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 1f831a413ea..c11c6b2a792 100644 --- a/plugins/modules/ecs_task.py +++ b/plugins/modules/ecs_task.py @@ -90,7 +90,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 @@ -101,7 +101,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 @@ -123,7 +123,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 @@ -139,7 +139,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 def891bb527..e7d3864a785 100644 --- a/plugins/modules/ecs_taskdefinition.py +++ b/plugins/modules/ecs_taskdefinition.py @@ -105,7 +105,7 @@ EXAMPLES = ''' - name: Create task definition - ecs_taskdefinition: + community.aws.ecs_taskdefinition: containers: - name: simple-app cpu: 10 @@ -146,7 +146,7 @@ register: task_output - name: Create task definition - ecs_taskdefinition: + community.aws.ecs_taskdefinition: family: nginx containers: - name: nginx @@ -160,7 +160,7 @@ state: present - name: Create task definition - ecs_taskdefinition: + community.aws.ecs_taskdefinition: family: nginx containers: - name: nginx @@ -177,7 +177,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 a6b1c627f4c..e4e93e0a90f 100644 --- a/plugins/modules/ecs_taskdefinition_info.py +++ b/plugins/modules/ecs_taskdefinition_info.py @@ -36,7 +36,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 5d6ce13e707..95e5df78499 100644 --- a/plugins/modules/efs.py +++ b/plugins/modules/efs.py @@ -106,8 +106,8 @@ ''' EXAMPLES = ''' -# EFS provisioning -- efs: +- name: EFS provisioning + community.aws.efs: state: present name: myTestEFS tags: @@ -117,8 +117,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: @@ -127,8 +127,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 992b650627e..bc2ddeda5a5 100644 --- a/plugins/modules/efs_info.py +++ b/plugins/modules/efs_info.py @@ -13,7 +13,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)" @@ -45,16 +45,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 e1c255ebbde..f649ea8010c 100644 --- a/plugins/modules/elasticache.py +++ b/plugins/modules/elasticache.py @@ -100,8 +100,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 @@ -114,13 +114,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 f7000116ca3..ffefc9b53a0 100644 --- a/plugins/modules/elasticache_info.py +++ b/plugins/modules/elasticache_info.py @@ -28,10 +28,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 c701d6a763d..c866fa9c83c 100644 --- a/plugins/modules/elasticache_parameter_group.py +++ b/plugins/modules/elasticache_parameter_group.py @@ -55,24 +55,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 f932544b505..4784dd53a29 100644 --- a/plugins/modules/elasticache_snapshot.py +++ b/plugins/modules/elasticache_snapshot.py @@ -52,16 +52,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 72b41f08ea6..3048f0a7baa 100644 --- a/plugins/modules/elasticache_subnet_group.py +++ b/plugins/modules/elasticache_subnet_group.py @@ -41,8 +41,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 @@ -50,8 +50,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 28915d551fa..c314a60aa40 100644 --- a/plugins/modules/elb_application_lb.py +++ b/plugins/modules/elb_application_lb.py @@ -185,7 +185,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 @@ -206,7 +206,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" @@ -230,7 +230,7 @@ state: present # Create an ALB with listeners and rules -- elb_application_lb: +- community.aws.elb_application_lb: name: test-alb subnets: - subnet-12345678 @@ -293,7 +293,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 2f9c1c39cc9..e1711dbef45 100644 --- a/plugins/modules/elb_application_lb_info.py +++ b/plugins/modules/elb_application_lb_info.py @@ -36,22 +36,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 bd309465abe..0ae1bc7dda5 100644 --- a/plugins/modules/elb_classic_lb.py +++ b/plugins/modules/elb_classic_lb.py @@ -138,7 +138,7 @@ # Basic provisioning example (non-VPC) -- elb_classic_lb: +- community.aws.elb_classic_lb: name: "test-please-delete" state: present zones: @@ -159,7 +159,7 @@ # Internal ELB example -- elb_classic_lb: +- community.aws.elb_classic_lb: name: "test-vpc" scheme: internal state: present @@ -176,7 +176,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: @@ -200,20 +200,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 @@ -223,7 +223,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: @@ -239,7 +239,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: @@ -253,7 +253,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' @@ -268,7 +268,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 @@ -285,7 +285,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 @@ -303,7 +303,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 @@ -321,7 +321,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 @@ -339,7 +339,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 915bf19aece..9341cb59b4b 100644 --- a/plugins/modules/elb_classic_lb_info.py +++ b/plugins/modules/elb_classic_lb_info.py @@ -43,10 +43,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: @@ -54,7 +54,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 @@ -62,7 +62,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 0c41ef3a6e4..20992459f57 100644 --- a/plugins/modules/elb_instance.py +++ b/plugins/modules/elb_instance.py @@ -64,10 +64,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 @@ -75,7 +73,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 616c8e061be..a3405fd5cae 100644 --- a/plugins/modules/elb_network_lb.py +++ b/plugins/modules/elb_network_lb.py @@ -135,8 +135,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 @@ -149,8 +149,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 @@ -163,8 +163,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 553e5f7f860..53d715578b8 100644 --- a/plugins/modules/elb_target.py +++ b/plugins/modules/elb_target.py @@ -75,27 +75,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 3818d5da7df..43723bfd6e9 100644 --- a/plugins/modules/elb_target_group.py +++ b/plugins/modules/elb_target_group.py @@ -168,16 +168,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 @@ -192,13 +192,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 @@ -215,8 +215,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 @@ -239,10 +239,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 @@ -250,7 +250,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 @@ -259,7 +259,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 2505026b0d7..5c4fa2f1f64 100644 --- a/plugins/modules/elb_target_group_info.py +++ b/plugins/modules/elb_target_group_info.py @@ -47,15 +47,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 40a9ac26420..af2dc55cd5b 100644 --- a/plugins/modules/elb_target_info.py +++ b/plugins/modules/elb_target_info.py @@ -36,14 +36,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 @@ -54,7 +54,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 }}" @@ -72,7 +72,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 }}" @@ -82,7 +82,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 }}" @@ -97,7 +97,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 45d0eef8e2b..846cf47d22a 100644 --- a/plugins/modules/execute_lambda.py +++ b/plugins/modules/execute_lambda.py @@ -74,7 +74,7 @@ ''' EXAMPLES = ''' -- execute_lambda: +- community.aws.execute_lambda: name: test-function # the payload is automatically serialized and sent to the function payload: @@ -84,11 +84,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 @@ -99,12 +99,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 9b5bae141c2..57d7ca653e3 100644 --- a/plugins/modules/iam.py +++ b/plugins/modules/iam.py @@ -99,9 +99,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 @@ -113,9 +112,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 @@ -124,8 +122,8 @@ - Luigi register: new_groups -- name: - iam: +- name: Update user + community.aws.iam: iam_type: user name: jdavila state: update @@ -134,7 +132,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 24e317b71c6..1ea54c859d3 100644 --- a/plugins/modules/iam_cert.py +++ b/plugins/modules/iam_cert.py @@ -83,24 +83,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/" @@ -108,8 +108,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 672de888fba..121801275eb 100644 --- a/plugins/modules/iam_group.py +++ b/plugins/modules/iam_group.py @@ -36,7 +36,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 @@ -76,20 +76,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 @@ -98,23 +98,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 06e31a906d5..0abe10faf5d 100644 --- a/plugins/modules/iam_managed_policy.py +++ b/plugins/modules/iam_managed_policy.py @@ -61,7 +61,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') }}" @@ -69,14 +69,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 @@ -84,7 +84,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 @@ -92,7 +92,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 bb59d8d8177..07e98d6851c 100644 --- a/plugins/modules/iam_mfa_device_info.py +++ b/plugins/modules/iam_mfa_device_info.py @@ -42,15 +42,17 @@ user_name: pwnall """ -EXAMPLES = ''' +EXAMPLES = r''' # 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: +# more details: https://docs.aws.amazon.com/IAM/latest/APIReference/API_ListMFADevices.html +- name: List MFA devices + 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: +# more details: https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html +- name: Assume an existing role + 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 53c1d5bc479..a26821e10a4 100644 --- a/plugins/modules/iam_password_policy.py +++ b/plugins/modules/iam_password_policy.py @@ -82,7 +82,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 5eb4694c3c7..7ff98790146 100644 --- a/plugins/modules/iam_policy.py +++ b/plugins/modules/iam_policy.py @@ -12,8 +12,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: @@ -70,7 +70,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 @@ -80,7 +80,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 @@ -90,7 +90,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" @@ -100,7 +100,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 73eded00824..8df1c9fc216 100644 --- a/plugins/modules/iam_policy_info.py +++ b/plugins/modules/iam_policy_info.py @@ -40,13 +40,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 dc96bc93f3f..1ce2ceae9d0 100644 --- a/plugins/modules/iam_role.py +++ b/plugins/modules/iam_role.py @@ -45,7 +45,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: @@ -98,7 +98,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 @@ -106,20 +106,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 7fdb4ac58fa..ac000ae8552 100644 --- a/plugins/modules/iam_role_info.py +++ b/plugins/modules/iam_role_info.py @@ -36,16 +36,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 7f8077bbb8a..0172a4cf47e 100644 --- a/plugins/modules/iam_saml_federation.py +++ b/plugins/modules/iam_saml_federation.py @@ -57,7 +57,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: > @@ -65,13 +65,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 cc123f9c22f..2f4728bbbad 100644 --- a/plugins/modules/rds.py +++ b/plugins/modules/rds.py @@ -15,7 +15,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: @@ -235,8 +235,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 @@ -248,35 +248,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 @@ -284,27 +284,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 efbffd8aa8b..bd40dd086d4 100644 --- a/plugins/modules/rds_instance.py +++ b/plugins/modules/rds_instance.py @@ -416,7 +416,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 @@ -425,7 +425,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 @@ -436,13 +436,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 8a23c392ddd..d26965a7970 100644 --- a/plugins/modules/rds_instance_info.py +++ b/plugins/modules/rds_instance_info.py @@ -41,13 +41,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 a30df260a25..e5cd2457458 100644 --- a/plugins/modules/rds_param_group.py +++ b/plugins/modules/rds_param_group.py @@ -67,8 +67,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' @@ -79,8 +79,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 872af39c8e6..3db9afe0b85 100644 --- a/plugins/modules/rds_snapshot.py +++ b/plugins/modules/rds_snapshot.py @@ -67,13 +67,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 30f30a815c1..3e47a444677 100644 --- a/plugins/modules/rds_snapshot_info.py +++ b/plugins/modules/rds_snapshot_info.py @@ -62,13 +62,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 99bfb002752..f913d41f296 100644 --- a/plugins/modules/rds_subnet_group.py +++ b/plugins/modules/rds_subnet_group.py @@ -42,8 +42,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 @@ -51,8 +51,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 86343d4ef79..6939204d819 100644 --- a/plugins/modules/redshift.py +++ b/plugins/modules/redshift.py @@ -174,16 +174,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 d7931a812b6..e97bf0795cd 100644 --- a/plugins/modules/redshift_cross_region_snapshots.py +++ b/plugins/modules/redshift_cross_region_snapshots.py @@ -61,7 +61,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 @@ -69,7 +69,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 @@ -78,7 +78,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 77aa5e1fb36..56e7f7139b7 100644 --- a/plugins/modules/redshift_info.py +++ b/plugins/modules/redshift_info.py @@ -39,27 +39,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 cb9d085e8c8..4351ac9e717 100644 --- a/plugins/modules/redshift_subnet_group.py +++ b/plugins/modules/redshift_subnet_group.py @@ -47,9 +47,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 @@ -57,8 +56,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 c93d941f39f..385a1d10ec4 100644 --- a/plugins/modules/route53.py +++ b/plugins/modules/route53.py @@ -212,108 +212,110 @@ sample: foo.bar.com. ''' -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 +EXAMPLES = r''' +- 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 @@ -323,39 +325,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 414f27a3eee..80f6691407a 100644 --- a/plugins/modules/route53_health_check.py +++ b/plugins/modules/route53_health_check.py @@ -84,8 +84,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 @@ -95,7 +95,7 @@ failure_threshold: 2 register: my_health_check -- route53: +- community.aws.route53: action: create zone: "example.com" type: CNAME @@ -107,8 +107,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 cb6f74b369a..466e39bd79f 100644 --- a/plugins/modules/route53_info.py +++ b/plugins/modules/route53_info.py @@ -136,19 +136,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 @@ -156,33 +156,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 @@ -191,12 +191,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 3eee17506f4..b7a2b6858ce 100644 --- a/plugins/modules/route53_zone.py +++ b/plugins/modules/route53_zone.py @@ -56,24 +56,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 41eaf3cfe72..6732e9a4432 100644 --- a/plugins/modules/s3_bucket_notification.py +++ b/plugins/modules/s3_bucket_notification.py @@ -13,10 +13,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: @@ -91,18 +91,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 9ab279d2b50..ceef7fd97d5 100644 --- a/plugins/modules/s3_lifecycle.py +++ b/plugins/modules/s3_lifecycle.py @@ -126,16 +126,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 @@ -143,10 +143,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" @@ -154,21 +154,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 @@ -176,8 +176,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 9d074f4876a..b672562131e 100644 --- a/plugins/modules/s3_logging.py +++ b/plugins/modules/s3_logging.py @@ -44,14 +44,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 aa527092d3c..879452af057 100644 --- a/plugins/modules/s3_sync.py +++ b/plugins/modules/s3_sync.py @@ -126,12 +126,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 5f0822af6fe..08d786cf0f1 100644 --- a/plugins/modules/s3_website.py +++ b/plugins/modules/s3_website.py @@ -52,19 +52,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 41c346ac317..0a0ceda75d6 100644 --- a/plugins/modules/sns.py +++ b/plugins/modules/sns.py @@ -88,14 +88,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! @@ -103,7 +103,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 52c21a41f0f..2f0865406d1 100644 --- a/plugins/modules/sns_topic.py +++ b/plugins/modules/sns_topic.py @@ -11,7 +11,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)" @@ -75,7 +75,7 @@ EXAMPLES = """ - name: Create alarm SNS topic - sns_topic: + community.aws.sns_topic: name: "alarms" state: present display_name: "alarm SNS topic" @@ -104,7 +104,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 763db04c774..1682d424592 100644 --- a/plugins/modules/sqs_queue.py +++ b/plugins/modules/sqs_queue.py @@ -169,8 +169,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 @@ -183,35 +183,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 f836e478e23..4048373c614 100644 --- a/plugins/modules/sts_assume_role.py +++ b/plugins/modules/sts_assume_role.py @@ -88,13 +88,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 d39519e8e0f..50c537623f6 100644 --- a/plugins/modules/sts_session_token.py +++ b/plugins/modules/sts_session_token.py @@ -60,20 +60,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 '''