# Error: invalid value for name when creating a Lightsail instance

**URL:** <https://discuss.hashicorp.com/t/error-invalid-value-for-name-when-creating-a-lightsail-instance/58079>\
**Category:** AWS\
**Created:** [September 8, 2023, 2:23pm UTC](https://discuss.hashicorp.com/t/error-invalid-value-for-name-when-creating-a-lightsail-instance/58079 "2023-09-08T14:23:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![suzie-utrains](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/suzie-utrains/32/37840_2.png) [@suzie-utrains](https://discuss.hashicorp.com/u/suzie-utrains)\
**Post date:** [September 8, 2023, 2:23pm UTC](https://discuss.hashicorp.com/t/error-invalid-value-for-name-when-creating-a-lightsail-instance/58079/1 "2023-09-08T14:23:03Z")

</div>

Hello all,

I’m trying to launch a Lightsail instance and I get the following error:

'Error: invalid value for name (must contain only alphanumeric characters, underscores, hyphens, and dots)  
│  
│ with aws\_lightsail\_instance.lightsail\_instance,  
│ on main.tf line 7, in resource “aws\_lightsail\_instance” “lightsail\_instance”:  
│ 7: name = “hello”

Here is my main.tf file

’ # Configure the AWS Provider  
provider “aws” {  
region = “us-east-2”  
}  
#creating the lightsail instance  
resource “aws\_lightsail\_instance” “lightsail\_instance” {  
name = “hello”  
availability\_zone = “us-east-2a”  
blueprint\_id = “ubuntu\_20\_04”  
bundle\_id = “nano\_1\_0”  
tags = {  
name = “devops”  
env = “dev”  
}  
} ’

I have modified the value on the name to no avail.  
Need help please

Thanks

---

<div class="post-metadata">

**Author:** ![TakashiAihara](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/takashiaihara/32/37858_2.png) [@TakashiAihara](https://discuss.hashicorp.com/u/TakashiAihara)\
**Post date:** [September 10, 2023, 4:12am UTC](https://discuss.hashicorp.com/t/error-invalid-value-for-name-when-creating-a-lightsail-instance/58079/2 "2023-09-10T04:12:40Z")

</div>

Probably a bug in terraform-provider-aws.  
Try fixing to 5.15.0 as a workaround.

terraform {  
required\_providers {  
aws = {  
source = “hashicorp/aws”  
version = “5.15.0”  
}  
}  
}
