AWS Lightsail Static IP Attachment
This page shows how to write Terraform and CloudFormation for Lightsail Static IP Attachment and write them securely.
aws_lightsail_static_ip_attachment (Terraform)
The Static IP Attachment in Lightsail can be configured in Terraform with the resource name aws_lightsail_static_ip_attachment
. The following sections describe 5 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "aws_lightsail_static_ip_attachment" "blog_beramaljariyah" {
static_ip_name = aws_lightsail_static_ip.blog_beramaljariyah.name
instance_name = aws_lightsail_instance.blog_beramaljariyah.name
}
resource "aws_route53_record" "baj_blog" {
resource "aws_lightsail_static_ip_attachment" "librata-io-static-ip-attachment" {
static_ip_name = aws_lightsail_static_ip.librata-io-static-ip.id
instance_name = aws_lightsail_instance.librata-io-wordpress.id
}
resource "aws_lightsail_static_ip_attachment" "default" {
static_ip_name = aws_lightsail_static_ip.default.id
instance_name = aws_lightsail_instance.default.id
}
resource "aws_lightsail_domain" "default" {
resource "aws_lightsail_static_ip_attachment" "test" {
static_ip_name = aws_lightsail_static_ip.test.id
instance_name = aws_lightsail_instance.test.id
}
resource "aws_lightsail_static_ip_attachment" "attach" {
static_ip_name = aws_lightsail_static_ip.static-ip.id
instance_name = aws_lightsail_instance.nodejsite.id
Parameters
-
id
optional computed - string -
instance_name
required - string -
ip_address
optional computed - string -
static_ip_name
required - string
Explanation in Terraform Registry
Provides a static IP address attachment - relationship between a Lightsail static IP & Lightsail instance.
Note: Lightsail is currently only supported in a limited number of AWS Regions, please see "Regions and Availability Zones in Amazon Lightsail" for more details
AWS::Lightsail::StaticIp (CloudFormation)
The StaticIp in Lightsail can be configured in CloudFormation with the resource name AWS::Lightsail::StaticIp
. The following sections describe how to use the resource and its parameters.
Example Usage from GitHub
An example could not be found in GitHub.
Parameters
-
StaticIpName
required - String -
AttachedTo
optional - String
Explanation in CloudFormation Registry
The
AWS::Lightsail::StaticIp
resource specifies a static IP that can be attached to an Amazon Lightsail instance that is in the same AWS Region and Availability Zone.
Frequently asked questions
What is AWS Lightsail Static IP Attachment?
AWS Lightsail Static IP Attachment is a resource for Lightsail of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.
Where can I find the example code for the AWS Lightsail Static IP Attachment?
For Terraform, the bentinata/tf, william-librata/librata-io-wordpress and devops-adeel/wordpress source code examples are useful. See the Terraform Example section for further details.