lightsail
Manage instances in AWS Lightsail
Collection: community.aws
Full Name: community.aws.lightsail
Synopsis
Manage instances in AWS Lightsail
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| access_key | str | |||
| aws_ca_bundle | path | |||
| aws_config | dict | |||
| blueprint_id | str | |||
| bundle_id | str | |||
| debug_botocore_endpoint_logs | bool | false | ||
| endpoint_url | str | |||
| key_pair_name | str | |||
| name | str | yes | ||
| profile | str | |||
| public_ports | list | |||
| region | str | |||
| secret_key | str | |||
| session_token | str | |||
| state | str | present | ||
| user_data | str | |||
| validate_certs | bool | true | ||
| wait | bool | true | ||
| wait_timeout | int | 300 | ||
| zone | str |
Example
yaml
- name: Create a new Lightsail instance
community.aws.lightsail:
state: present
name: my_instance
region: us-east-1
zone: us-east-1a
blueprint_id: ubuntu_16_04
bundle_id: nano_1_0
key_pair_name: id_rsa
user_data: " echo 'hello world' > /home/ubuntu/test.txt"
public_ports:
- from_port: 22
to_port: 22
protocol: "tcp"
cidrs: ["0.0.0.0/0"]
ipv6_cidrs: ["::/0"]
register: my_instance
- name: Delete an instance
community.aws.lightsail:
state: absent
region: us-east-1
name: my_instance