Skip to content

Instantly share code, notes, and snippets.

@wabmca
Created October 9, 2021 14:39
Show Gist options
  • Save wabmca/55777ac4c57190be4a831e81a3d16e48 to your computer and use it in GitHub Desktop.
Save wabmca/55777ac4c57190be4a831e81a3d16e48 to your computer and use it in GitHub Desktop.
- name: Create ALB
elb_application_lb:
name: "{{ tg_name }}"
state: present
region: '{{ region }}'
security_groups: '{{ aws_env[env][region].group_id }}'
subnets: "{{ aws_env[env][region].vpc_subnet_ids }}"
purge_listeners: yes
deletion_protection: yes
listeners:
- Protocol: HTTPS
Port: 443 # Required. The port on which the load balancer is listening.
SslPolicy: ELBSecurityPolicy-2015-05
Certificates: # The ARN of the certificate (only one certficate ARN should be provided)
- CertificateArn: "{{ cert_arn }}"
DefaultActions:
- Type: forward # Required.
TargetGroupName: # Required. The name of the target group
register: alb_with_listeners
when: region == 'eu-west-1' and node_type == "feedmaster"
{
"exception": "Traceback (most recent call last):\n File \"/tmp/ansible_elb_application_lb_payload_Jwfjz5/ansible_elb_application_lb_payload.zip/ansible/module_utils/aws/elb_utils.py\", line 103, in convert_tg_name_to_arn\n response = AWSRetry.jittered_backoff()(connection.describe_target_groups)(Names=[tg_name])\n File \"/tmp/ansible_elb_application_lb_payload_Jwfjz5/ansible_elb_application_lb_payload.zip/ansible/module_utils/cloud.py\", line 153, in retry_func\n raise e\nParamValidationError: Parameter validation failed:\nInvalid type for parameter Names[0], value: None, type: <type 'NoneType'>, valid types: <type 'basestring'>\n",
"_ansible_no_log": false,
"botocore_version": "1.9.23",
"changed": false,
"invocation": {
"module_args": {
"profile": null,
"subnets": [
"subnet-04d5884c225252501",
"subnet-0793d3bf296298d33",
"subnet-08aae21c38baa15e1"
],
"purge_rules": true,
"tags": null,
"purge_tags": true,
"debug_botocore_endpoint_logs": false,
"idle_timeout": null,
"deletion_protection": true,
"ec2_url": null,
"access_logs_s3_prefix": null,
"security_groups": [
"sg-0dfdfc80d0a501e93"
],
"access_logs_enabled": null,
"aws_secret_key": null,
"aws_access_key": null,
"name": "canv2-eu-org-cloud-fm",
"security_token": null,
"access_logs_s3_bucket": null,
"region": "eu-west-1",
"listeners": [
{
"SslPolicy": "ELBSecurityPolicy-2015-05",
"Protocol": "HTTPS",
"Certificates": [
{
"CertificateArn": "arn:aws:iam::694702677705:server-certificate/snaplogic.io"
}
],
"Rules": null,
"DefaultActions": [
{
"Type": "forward",
"TargetGroupName": null
}
],
"Port": 443
}
],
"wait": false,
"state": "present",
"wait_timeout": null,
"purge_listeners": true,
"http2": null,
"scheme": "internet-facing",
"validate_certs": true
}
},
"boto3_version": "1.6.2",
"msg": "Parameter validation failed:\nInvalid type for parameter Names[0], value: None, type: <type 'NoneType'>, valid types: <type 'basestring'>"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment