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

github-iconbentinata/tf
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" {
github-iconwilliam-librata/librata-io-wordpress
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
}
github-icondevops-adeel/wordpress
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" {
github-iconHtunn/IaC_Terraform
resource "aws_lightsail_static_ip_attachment" "test" {
  static_ip_name = aws_lightsail_static_ip.test.id
  instance_name  = aws_lightsail_instance.test.id
}

github-iconatl-rom/nodejs_lightsail
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

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.

Parameters

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.