Git Product home page Git Product logo

Comments (5)

tomiszili avatar tomiszili commented on June 2, 2024 1

Hello @knoxilla

To be honest i'm not developing a generic solution for this problem, because i'm not patient enough to add this feature. I copy the existing template and deleted/changed all those sections i don't want to use for amazonlinux2.

I had this problem for so long, so the script under Userdata should be debugged line by line on an EC2 with empty amzlinux2.
As far as i remember the first issue is with the yum can't install the epel-release, because you first have to run some costum command, which the yum install -y epel-release will return.
But I realised that you don't have to install the epel-release, you can simply run yum install -y python2-pip if you want pip2, but you have natively installed pip3 and awscli on amazonlinux2.

So if you want to use amazonlinux2 only, you should rewrite the userdata of the template.
Change all these lines: https://github.com/aws-quickstart/quickstart-linux-bastion/blob/master/templates/linux-bastion.template#L569-L585 to
pip3 install awscli --upgrade

from quickstart-linux-bastion.

knoxilla avatar knoxilla commented on June 2, 2024

I tweaked the cfn template enough to allow me to deploy the stack using an amzn2 AMI, and things seemed to work OK at first glance. I just did some quick hacks by adding an AMI choice in us-east-1 a la

...
AMZNLINUX2HVM: amzn2-ami-hvm-x86_64-gp2
...
AMZNLINUX2HVM: ami-0b69ea66ff7391e80
...

As I said, it deployed and an instance came up in the ASG and allowed me to connect. Yay!

But the cfn-init failed and bastion.log & CloudWatch logging (among other things, I'm sure) are not happening.

I was hoping I could help push this along but clearly there is more involved beyond my knowledge. I now you are working on v2, and you have my thanks for that!

In case it does help, here is what was logged in /var/log/cloud-init-output.log when things went boom:

+ cfn-init -v --stack linux-bastion --resource BastionLaunchConfiguration --region us-east-1
Traceback (most recent call last):
  File "/usr/bin/cfn-init", line 4, in <module>
    __import__('pkg_resources').run_script('aws-cfn-bootstrap==1.4', 'cfn-init')
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 750, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1518, in run_script
    .format(**locals()),
pkg_resources.ResolutionError: Script 'scripts/cfn-init' not found in metadata at None
+ cfn-signal -e 1 --stack linux-bastion --resource BastionAutoScalingGroup --region us-east-1
Traceback (most recent call last):
  File "/usr/bin/cfn-signal", line 4, in <module>
    __import__('pkg_resources').run_script('aws-cfn-bootstrap==1.4', 'cfn-signal')
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 750, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1518, in run_script
    .format(**locals()),
pkg_resources.ResolutionError: Script 'scripts/cfn-signal' not found in metadata at None
Sep 25 17:01:31 cloud-init[3424]: util.py[WARNING]: Failed running /var/lib/cloud/instance/scripts/part-001 [1]
Sep 25 17:01:31 cloud-init[3424]: cc_scripts_user.py[WARNING]: Failed to run module scripts-user (scripts in /var/lib/cloud/instance/scripts)
Sep 25 17:01:31 cloud-init[3424]: util.py[WARNING]: Running module scripts-user (<module 'cloudinit.config.cc_scripts_user' from '/usr/lib/python2.7/site-packages/cloudin
Cloud-init v. 18.2-72.amzn2.0.7 finished at Wed, 25 Sep 2019 17:01:31 +0000. Datasource DataSourceEc2.  Up 36.45 seconds

from quickstart-linux-bastion.

knoxilla avatar knoxilla commented on June 2, 2024

Thanks much. I will give it a go - thanks for the pointers and recap of things you'ave already figured out. Cheers,

-t

from quickstart-linux-bastion.

timtubescience avatar timtubescience commented on June 2, 2024

+1

I am trying to get psql client v10 installed, to connect to a psql 10 RDS instance. It should be wicked easy to get 10 installed on amazon linux 2, and I fear staying on the older version of amazon linux, since support already seems to be dwindling.

from quickstart-linux-bastion.

tonynv avatar tonynv commented on June 2, 2024

Added in

Mappings:
AWSAMIRegionMap:
ap-northeast-1:
AMZNLINUX2: ami-011facbea5ec0363b
AMZNLINUXHVM: ami-0ab3e16f9c414dee7
CENTOS7HVM: ami-045f38c93733dd48d
US1604HVM: ami-014cc8d7cb6d26dc8
US1804HVM: ami-0f6b4f4104d26f399
SLES15HVM: ami-056ac8ad44e6a7e1f
ap-northeast-2:
AMZNLINUX2: ami-0bea7fd38fabe821a
AMZNLINUXHVM: ami-0e1e385b0a934254a
CENTOS7HVM: ami-06cf2a72dadf92410
US1604HVM: ami-004b3430b806f3b1a
US1804HVM: ami-02b4a5559ce53a570
SLES15HVM: ami-0f81fff879bafe6b8
ap-south-1:
AMZNLINUX2: ami-0217a85e28e625474
AMZNLINUXHVM: ami-02913db388613c3e1
CENTOS7HVM: ami-02e60be79e78fef21
US1604HVM: ami-0f59afa4a22fad2f0
US1804HVM: ami-0245841fc4b40e22f
SLES15HVM: ami-01be89269d32f2a16
ap-southeast-1:
AMZNLINUX2: ami-05c64f7b4062b0a21
AMZNLINUXHVM: ami-05c859630889c79c8
CENTOS7HVM: ami-0b4dd9d65556cac22
US1604HVM: ami-08b3278ea6e379084
US1804HVM: ami-07febfdfb4080320e
SLES15HVM: ami-070356c21596ddc67
ap-southeast-2:
AMZNLINUX2: ami-0b8b10b5bf11f3a22
AMZNLINUXHVM: ami-07cc15c3ba6f8e287
CENTOS7HVM: ami-08bd00d7713a39e7d
US1604HVM: ami-00d7116c396e73b04
US1804HVM: ami-04a0f7552cff370ba
SLES15HVM: ami-0c4245381c67efb39
ca-central-1:
AMZNLINUX2: ami-0a269ca7cc3e3beff
AMZNLINUXHVM: ami-04070f04f450607dc
CENTOS7HVM: ami-033e6106180a626d0
US1604HVM: ami-0086bcfbab4b22f60
US1804HVM: ami-0972a0d3135cf1fc0
SLES15HVM: ami-0c97d9b588207dad6
eu-central-1:
AMZNLINUX2: ami-07cda0db070313c52
AMZNLINUXHVM: ami-010fae13a16763bb4
CENTOS7HVM: ami-04cf43aca3e6f3de3
US1604HVM: ami-0062c497b55437b01
US1804HVM: ami-09356619876445425
SLES15HVM: ami-05dfd265ea534a3e9
eu-north-1:
AMZNLINUX2: ami-0662eb9b9b8685935
AMZNLINUXHVM: ami-6a1f9414
CENTOS7HVM: ami-5ee66f20
US1604HVM: ami-0ca3b50bc99a41773
US1804HVM: ami-005bc7d72deb72a3d
SLES15HVM: ami-0741fa1a008af40ad
eu-west-1:
AMZNLINUX2: ami-0713f98de93617bb4
AMZNLINUXHVM: ami-028188d9b49b32a80
CENTOS7HVM: ami-0ff760d16d9497662
US1604HVM: ami-0987ee37af7792903
US1804HVM: ami-04c58523038d79132
SLES15HVM: ami-0a58a1b152ba55f1d
eu-west-2:
AMZNLINUX2: ami-0089b31e09ac3fffc
AMZNLINUXHVM: ami-04de2b60dd25fbb2e
CENTOS7HVM: ami-0eab3a90fc693af19
US1604HVM: ami-05945867d79b7d926
US1804HVM: ami-00622b440d92e55c0
SLES15HVM: ami-01497522185aaa4ee
eu-west-3:
AMZNLINUX2: ami-007fae589fdf6e955
AMZNLINUXHVM: ami-0652eb0db9b20aeaf
CENTOS7HVM: ami-0e1ab783dc9489f34
US1604HVM: ami-00c60f4df93ff408e
US1804HVM: ami-0b70d1460d5c7a299
SLES15HVM: ami-0f238bd4c6fdbefb0
sa-east-1:
AMZNLINUX2: ami-09de7b4017733e2af
AMZNLINUXHVM: ami-0e2c2c29d8017dd99
CENTOS7HVM: ami-0b8d86d4bf91850af
US1604HVM: ami-0fb487b6f6ab53ff4
US1804HVM: ami-049f5d88d2d436431
SLES15HVM: ami-0772af912976aa692
us-east-1:
AMZNLINUX2: ami-062f7200baf2fa504
AMZNLINUXHVM: ami-00eb20669e0990cb4
CENTOS7HVM: ami-02eac2c0129f6376b
US1604HVM: ami-09f9d773751b9d606
US1804HVM: ami-00a208c7cdba991ea
SLES15HVM: ami-0b1764f3d7d2e2316
us-gov-west-1:
AMZNLINUXHVM: ami-6cfab40d
AMZNLINUX2: ami-a03768c1
US1404HVM: ami-c5930ca4
US1604HVM: ami-9e7d22ff
SLES15HVM: ami-a61b4fc7
us-gov-east-1:
AMZNLINUXHVM: ami-28ed0d59
AMZNLINUX2: ami-7c2bc80d
US1404HVM: ami-21a64050
US1604HVM: ami-a529cad4
SLES15HVM: ami-0e85d9b9717e16d66
us-east-2:
AMZNLINUX2: ami-02ccb28830b645a41
AMZNLINUXHVM: ami-0c64dd618a49aeee8
CENTOS7HVM: ami-0f2b4fc905b0bd1f1
US1604HVM: ami-0891395d749676c2e
US1804HVM: ami-059d836af932792c3
SLES15HVM: ami-05ea824317ffc0c20
us-west-1:
AMZNLINUX2: ami-03caa3f860895f82e
AMZNLINUXHVM: ami-0bce08e823ed38bdd
CENTOS7HVM: ami-074e2d6769f445be5
US1604HVM: ami-0c0e5a396959508b0
US1804HVM: ami-0f42d8c4eb586ccf7
SLES15HVM: ami-00e34a7624e5a7107
us-west-2:
AMZNLINUX2: ami-04590e7389a6e577c
AMZNLINUXHVM: ami-08d489468314a58df
CENTOS7HVM: ami-01ed306a12b7d1c96
US1604HVM: ami-0bbe9b07c5fe8e86e
US1804HVM: ami-0a7d051a1c4b54f65
SLES15HVM: ami-0f1e3b3fb0fec0361
LinuxAMINameMap:
Amazon-Linux2-HVM:
Code: AMZNLINUX2
Amazon-Linux-HVM:
Code: AMZNLINUXHVM
CentOS-7-HVM:
Code: CENTOS7HVM
Ubuntu-Server-18.04-LTS-HVM:
Code: US1804HVM
Ubuntu-Server-16.04-LTS-HVM:
Code: US1604HVM
SUSE-SLES-15-HVM:
Code: SLES15HVM

from quickstart-linux-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.