Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aws_lightsail provider should support open port management #700

Closed
hashibot opened this issue Jun 13, 2017 · 12 comments · Fixed by #8611
Closed

aws_lightsail provider should support open port management #700

hashibot opened this issue Jun 13, 2017 · 12 comments · Fixed by #8611
Assignees
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/lightsail Issues and PRs that pertain to the lightsail service.
Milestone

Comments

@hashibot
Copy link

This issue was originally opened by @sean-brandt as hashicorp/terraform#13759. It was migrated here as part of the provider split. The original body of the issue is below.


Hi there,

Thank you for opening an issue. Please note that we try to keep the Terraform issue tracker reserved for bug reports and feature requests. For general usage questions, please see: https://www.terraform.io/community.html.

Terraform Version

Run terraform -v to show the version. If you are not running the latest version of Terraform, please upgrade because your issue may have already been fixed.

Terraform v0.9.3

Affected Resource(s)

Please list the resources as a list, for example:

  • aws_lightsail

If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.

Expected Behavior

What should have happened?

aws_lightsail provider should allow for managing open ports

@hashibot hashibot added the enhancement Requests to existing resources that expand the functionality or scope. label Jun 13, 2017
@xeraa
Copy link

xeraa commented Aug 19, 2017

https://docs.aws.amazon.com/cli/latest/reference/lightsail/put-instance-public-ports.html should be the API to use for this

@radeksimko radeksimko added the service/lightsail Issues and PRs that pertain to the lightsail service. label Jan 25, 2018
@PlugIN73
Copy link

Hi! Will this be done?

@alambike
Copy link

👍
@radeksimko, is there any plan to acomplish this? or any other aws resource that can be used to this? Thanks

@n3integration
Copy link

@radeksimko - are there plans to address this anytime in the near future? i could take a stab at implementing it and submit a pr if we can agree on a schema.

resource "aws_lightsail_firewall" "www" {
  instance_name = "${aws_lightsail_instance.app.name}"
  port_rules = [{
     fromPort = 443
     toPort      = 443
     protocol  = "tcp | all | udp"
  }]
}

thoughts?

@steve-gray
Copy link

@n3integration - Did you ever build on this? I'm using a local-exec with aws CLI to solve for now, but this pretty royally sucks as it relies on local tooling.

@blckct
Copy link
Contributor

blckct commented Jul 9, 2019

There's a PR #8611 open for this currently.

@hieuhtr
Copy link

hieuhtr commented Feb 25, 2020

So far the latest terraform-provider-aws 2.50.0 does not support us to create firewall rule for lightsail instance. We can wait for PR.

But we can cheat it by using local-exec with built-in aws cli put-instance-public-ports. It will be executed after provisioned instance, in the machine that run terraform:

resource "aws_lightsail_instance" "worker" {
  ...
  name              = "worker-${count.index+1}"
  availability_zone = "ap-southeast-1a"
  blueprint_id      = "ubuntu_18_04"
  bundle_id         = "nano_2_0"
  ...
  provisioner "local-exec" {
    command = "aws lightsail put-instance-public-ports --instance-name=worker-${count.index+1} --port-infos fromPort=22,toPort=22,protocol=tcp fromPort=5601,toPort=5601,protocol=tcp"
  }
}

@leacollaboro
Copy link

What's the latest on this? Using terraform cloud means that we'd also need to install and setup the aws command. I didn't think we needed to as yesterday it was working fine but it seems like today the runners don't have the command installed. Merging this PR would be a godsend.

@samyak-jain
Copy link

There seem to be 2 PRs for this #8611 and #14905. Are both the same or is there a difference?

@zicklag
Copy link

zicklag commented Mar 25, 2021

Yay, thanks @YakDriver and @mavericknsk !

@YakDriver YakDriver self-assigned this Mar 25, 2021
@ghost
Copy link

ghost commented Mar 26, 2021

This has been released in version 3.34.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@ghost
Copy link

ghost commented Apr 24, 2021

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Apr 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/lightsail Issues and PRs that pertain to the lightsail service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.