GithubHelp home page GithubHelp logo

Comments (7)

Guimove avatar Guimove commented on August 29, 2024

mmh I don't see any issue with your code, I think the issue is in the user data script execution.

Are all the scripts created on the server ?

I mean are these script present on the bastion :

  • /usr/bin/bastion/sync_users
  • /usr/bin/bastion/sync_s3
  • /usr/bin/bastion/shell

The crontab of the root user is empty ?

from terraform-aws-bastion.

brunelloriserva avatar brunelloriserva commented on August 29, 2024

from terraform-aws-bastion.

matloob-smartmimic avatar matloob-smartmimic commented on August 29, 2024

I am getting the same issue as well, however I see crontab entries present on my bastion box, also files sync_users is also present at /usr/bin/bastion/

[root@ip-10-122-22-79 home]# crontab -l
*/5 * * * * /usr/bin/bastion/sync_users
0 0 * * * yum -y update --security
*/5 * * * * /usr/bin/bastion/sync_s3

@brunelloriserva did you get your problem sorted?
@Guimove - can you please help us with this.

AWS- Looks like on this bastion aws cli version is 1.2x

NOTE- I am not sure, but looks like it does not respond at following script line
aws s3api list-objects --bucket

from terraform-aws-bastion.

kcasas avatar kcasas commented on August 29, 2024

I got the same issue and it has something to do with the s3 bucket name.
I renamed the s3 bucket after the second apply. The s3 bucket was replaced just fine but the scripts inside the ec2 instance was not updated and it still points to the old bucket.

from terraform-aws-bastion.

kcasas avatar kcasas commented on August 29, 2024

@matloob-smartmimic @brunelloriserva I resolved my issue by making sure that the bastion EC2 instance is updated with the latest launch template template version. You can compare the EC2 tag aws:ec2launchtemplate:version with the launch template tag.

TLDR: Triggering instance refresh on EC2 > Auto Scaling Groups > ${bastion ASG} > Instance Refresh resolved my issue. You can also do this using awscli.

@Guimove I guess the fix would be utilizing https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/autoscaling_group#instance_refresh.

from terraform-aws-bastion.

josescuderoh avatar josescuderoh commented on August 29, 2024

I had this problem when I was setting the auto_scaling_group_subnets to private subnets just like @brunelloriserva. The fix was using public subnets for the ASG and triggering an Instance Refresh as indicated by @kcasas

from terraform-aws-bastion.

ruiwei avatar ruiwei commented on August 29, 2024

@josescuderoh I'm having the same problem. how do you trigger an Instance Refresh?

from terraform-aws-bastion.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.