mercredi 26 août 2015

Invalid subnet when creating AWS RDS subnet group with rds_subnet_group module

I have a role that I'm using to create an RDS Subnet Group as well as an RDS instance with Ansible. When I run it, I get this error message of:

failed: [localhost -> 127.0.0.1] => {"failed": true}
msg: Some input subnets in :[['subnet-834108da', 'subnet-7ef48655']] are invalid.

It bombs out after the first action. I'm not sure why these are invalid as I can create the subnet group in the AWS console using these subnets.

The subnets in question aren't in my default VPC.

Here is the code from the role. I appreciate any pointers.

---
  - name: create RDS subnet group
    local_action: rds_subnet_group
        state=present
        name=subnetGroup
        region="{{ region }}"
        description="my subnet group"
        subnets="['{{ subnet }}','{{ alternatesubnet }}']"

  - name: Launching new rds instances for {{ env }} - {{ store }}
    local_action: rds
        command=create
        instance_name="postgres-{{ env }}-{{ store }}"
        db_engine="postgres"
        db_name="arts_v6"
        engine_version=""
        instance_type=db.m3.large
        username=postgres
        size=10
        port=5432
        password=postgres
        subnet=subnetGroup
        vpc_security_groups={{ group_id }}
        region={{ region }}
    register: rds




Aucun commentaire:

Enregistrer un commentaire