Question: @gavin.hardy i got it all sorted in the end my nginx container gets assigned a random port and added to the target group automatically Is there a way i can remove the port 80 target on my load balancer target group?

Asked By
j.wallen.jones
Asked At
2018-03-17 14:40:07

Found 15 possible answers.

User Answered At Possible Answer
gavin.hardy 2018-03-17 19:27:58 @j.wallen.jones are you using an ALB?
j.wallen.jones 2018-03-18 10:21:50 yeah @gavin.hardy }
  depends_on = ["aws_lb.myclub-staging"]
  vpc_id     = "${aws_vpc.myclub_staging.id}"
  protocol   = "HTTP"
  port       = 80
  name       = "${aws_lb.myclub-staging.name}-tg"
resource "aws_lb_target_group" "myclub_staging" {
josh502 2018-03-28 22:40:13 anybody manage internal service monitors (nagios checks, something else) with terraform? It would be so cool for us to be able to have that in terraform too things that dont have a direct host like monitoring aws elasticsearch availability and alerting
rvg 2018-04-06 22:24:14 At my company, we try to measure quarter goal progress via metrics. One of our more generalized quarterly goals this quarter is to begin using Terraform to both migrate existing resources and create new resources, mostly on AWS. We
eghobor 2018-04-08 21:53:16 Hi , can anyone help out? I am stuck at the error * aws_instance.web: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain . Most materials say to set agent to false, which I have done but still no luck. Thanks.
provider "aws" {
} } ] "sudo bash /usr/local/bin/bootstrap.sh" "sudo mv /tmp/bootstrap.sh /usr/local/bin/bootstrap.sh", "sudo mv /tmp/api /var", "sudo mv /tmp/mongodb-org-3.4.repo /etc/yum.repos.d", inline = [ provisioner "remote-exec" { }, } agent = "false" timeout = "15m" private_key = "${file("/tmp/api/terraform_rsa")}" user = "ec2-user" type = "ssh" connection { destination = "/tmp" source = "/tmp/api/bootstrap.sh", provisioner "file" { }, } agent = "false" timeout = "15m" private_key = "${file("/tmp/api/terraform_rsa")}" user = "ec2-user" type = "ssh" connection { destination = "/tmp" source = "/tmp/api/api", provisioner "file" { }, } agent = "false" timeout = "15m" private_key = "${file("/tmp/api/terraform_rsa")}" user = "ec2-user" type = "ssh" connection { destination = "/tmp" source = "/tmp/api/mongodb-org-3.4.repo", provisioner "file" { } Name = "example" tags { security_groups = ["docker-security-group"] key_name = "terraform_rsa" instance_type = "t2.small" ami = "ami-3079f543" resource "aws_instance" "web" { }, public_key = "my_public_key" key_name = "terraform_rsa" resource "aws_key_pair" "deployer" { }, region = "eu-west-1" secret_key = "my_secret_key" access_key = "my_access_key"
rilindo.foster 2018-04-09 01:51:06 If I am not mistaken, ami-3079f543 belongs to ubuntu.
Otherwise, if ec2-user and root don't work, check with the AMI provider.
For an Ubuntu AMI, the user name is ubuntu or root.
For a SUSE AMI, the user name is ec2-user or root.
For a RHEL AMI, the user name is ec2-user or root.
For a Fedora AMI, the user name is ec2-user or fedora.
For a Debian AMI, the user name is admin or root.
For a Centos AMI, the user name is centos.
For an Amazon Linux AMI, the user name is ec2-user.
Get the default user name for the AMI that you used to launch your instance https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AccessingInstancesLinux.html Ubuntu images do not use the “ec2-user” as the username, but rather “ubuntu” https://cloud-images.ubuntu.com/releases/16.04/release-20160420.3/published-ec2-release.txt.orig
eghobor 2018-04-09 10:01:36 Thanks so much @rilindo.foster that was totally helpful. I never thought in that direction. It works perfectly now sleep 1
 Is there is a way of starting the server in a different detached process entirely such that it doesn't depend on the parent one that is used to run the script. I know screen does that but just not sure how to implement it in the script. Thanks a lot.
nohup node server.js &
npm install
<@rilindo.foster> and everyone , I am having other issues , any further help will be highly appreciated. Now I am running the bootstrap script as above in terraform remote-exec provisioner as above :point_up_2: `" bash /usr/local/bin/bootstrap.sh"` but when the script finishes the 'node server.js' process dies even if I have used nohup . I understand the parent process that is running the script kills it as soon as the script exits. I have also tried to not use exit on the script but use inline exit command in terraform such that that script process doesn't die but terraform exits. Still doesn't work. However if I don't include exit command in both the script and in terraform, the application is started but terraforms keeps saying `still-creating` even if the script has finished running. Here is the content of the last bit of the script causing issues. Not sure what to do.
cd api
rilindo.foster 2018-04-15 15:01:39 @eghobor You should write a service service to start it up. Something like this: https://askubuntu.com/questions/919054/how-do-i-run-a-single-command-at-startup-using-systemd
eghobor 2018-04-15 18:08:19 thanks @rilindo.foster I will try that and let you know
shtrull 2018-04-16 13:12:13 hi, anyone have a cfn template to create a Kinesis Firehose redshift delivery stream or is there a way to export to file the setup i have created manually ?
shannonrdunn 2018-04-23 15:09:26 you mean like a nagios provisioner?
ghardy 2018-04-24 11:04:33 Hi, what is the correct syntax for this I want terraform to know use the variable name but getting error resource "aws_instance" "com6-${var.env_name}-beanstalk"
josh502 2018-04-24 13:42:54 pretty sure you cant do that and I would say its bad practice to do anyways that name is internal to terraform
jordan 2018-04-24 17:59:15 yea you don't want to set it there - you want to set it as the name of the instance you can use Workspaces if you need multiple environments
gavin.hardy 2018-04-24 18:29:28 Never used workspaces before

Related Questions