EB CLI "eb create" ERROR: InvalidParameterValueError - Platform ARN is invalid - node.js

I'm trying to create an Elastic Beanstalk node.js environment via the EB CLI. I've ran eb init in my code repo, and this doesn't give me any issues.
Next, when I run eb create to create the environment, I receive the error ERROR: InvalidParameterValueError - Platform ARN is invalid: Not an IAM ARN: 64bit Amazon Linux 2018.03 v4.15.2 running Node.js.
I've searched for this error, it seems like I need to update the platform version, but I can't figure out how to do that.
I also downgraded my node version from v12.18.4 to v12.18.3 because the EB docs didn't say that v12.18.4 was supported.

You can just run:
eb platform select
to select new default platform. Nevertheless, your platform seems fine as it is current one as listed here. Thus there maybe something else causing this error. But still maybe worth changing or re-selecting the platform version.

I ran into a very similar issue with a Python project containing a Dockerfile.
Inside the project I ran eb create --database (version EB CLI 3.19.3).
It prompted me to pick an environment name and DNS CNAME prefix, which was fine.
It then asked to Select a load balancer type.
I picked the default, which is 2 (application).
As soon as I hit enter, I got the following error:
ERROR: InvalidParameterValueError - Platform ARN is invalid: Not an IAM ARN: 64bit Amazon Linux 2 v3.2.4 running Docker.
Following Marcin's hint I ran eb platform select.
It prompted me about Docker:
It appears you are using Docker. Is this correct?
(Y/n): y
It then prompted me to select a platform:
Select a platform branch.
1) Docker running on 64bit Amazon Linux 2
2) Multi-container Docker running on 64bit Amazon Linux
3) Docker running on 64bit Amazon Linux
(default is 1): 1
This solved the problem.
Even though this is (seemingly) the same setup that was picked by default, eb create --database worked without the error afterwards, and even eb status show
Platform: arn:aws:elasticbeanstalk:eu-west-2::platform/Docker running on 64bit Amazon Linux 2/3.2.4

eb platform select - overrides the default platform. In cases, where you want to create an environment that uses a different platform than default one, we can simply provide -p or --provide then the platform.
I was able to successfully do it by running the following command using nodev16 platform
eb create --platform "Node.js 16 running on 64bit Amazon Linux 2"

I ended up creating the environment in the EB console instead of the CLI. The environment was created successfully from here.

Related

Self host runner in github action

The hosts on github action are in US only and I need to run my tests from EU region. I created AWS ec2 with eu region and connect my github workflow to the instance. I installed python3.10 on my ec2 :
enter image description here
but when I try to run the test I get this error:
Version 3.10.0 was not found in the local cache
Error: Version 3.10.0 with arch x64 not found
The list of all available versions can be found here: https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json
Do any one know what should I do ?
try to change version , without any version reinstall python. didn't work for me...

How do I install a Linux build runner for bitbucket using rust?

I have a CI server in an AWS cloud which hosts out BitBucket.
The runners are on a separate EC2 instance.
The code we are using is Rust.
I installed the runners on a windows EC2 and everything is fine.
I follow the instructions to install the runners on a Linux machine (Ubuntu) and the runners cannot find Cargo.
When I connect to the machine I can run it manually from any directory so it should be viewable by the build runner.
Has anyone come across this issue? I read that I might need to specific the bitness of the system when I install Rust but that did not seem to help :-(
Edit:
I have added the location of Cargo to /etc/environment and to the PATH variable in case the runner could not see it but that has not helped.

How to install IIS in Windows EC2 using AWS CodeDeploy?

I need to deploy a .NET project on an EC2 instance running Windows, and in order for the code to run I need to make sure the instance has IIS installed.
This also needs to be automated (hence the need for CodeDeploy).
How can I install IIS and MS-SQL using CodeDeploy?
I'm a bit familiar with CodeBuild but I don't think it will particularly help me here. I'm using CodeBuild to build/compile the .NET application and put the output in S3. Now I need the next step which is taking that code and putting it on an EC2 running IIS and MS-SQL.
I would recommend to install IIS/MS-Sql from within UserData of the EC2 instance or use a Pre-baked (Golden) Image approach. Installing software via CodeDeploy is not recommended as such feature installation may take long time in Windows environment and is error prone.
An example UserData to install IIS on Windows is as follows:
<powershell>
Import-Module ServerManager
tzutil /s "AUS Eastern Standard Time"
Add-WindowsFeature Web-WebServer -includeAllSubFeature -logpath $env:temp\\Web-WebServer_feature.log
Add-WindowsFeature Web-Mgmt-Tools -includeAllSubFeature -logpath $env:temp\\Web-Mgmt-Tools_feature.log
</powershell>
Use CodeDeploy to Deploy your application artifacts and restart any service(s) if required. Deployment instructions for CodeDeploy are stored in appspec.yml file in the root of your source package. The syntax for a Windows version to deploy to IIS is detailed here [1].
References:
[1] https://docs.aws.amazon.com/codedeploy/latest/userguide/tutorials-windows-configure-content.html#tutorials-windows-configure-content-add-appspec-file

Upgrading AWS EB Platform version from 2.0.1 to 3.1.0

My current platform version is: Node.js running on 64bit Amazon Linux/2.0.1
Which support following NodeJS versions: 0.12.6, 0.10.39, 0.10.38, 0.10.31, 0.8.28
I am looking a way to upgrade the NodeJS version: 4.x.x which seems to be available in platform version: Node.js running on 64bit Amazon Linux/3.1.0
but when I am upgrading it. it's says
How can I select the allowed version as it's not available.
Any Help,
Thanks,
P.S
1. Already tried via save / load configurations. Unable to find any option there.
2. Don't want to do setup it from the scratch for now.
First, ensure that you have tested the changes adequately before deploying to production. After that, you can:
Note the name of the Platform ARN/Solution Stack you want to upgrade to.
Perform eb init --region REGION_NAME and pick the application and environment you are working on
Perform eb config. This opens your environment's configuration in an editor. Change the value of the PlatformArn to the one you noted above in step 1.
Also in the editor, find the option setting aws:elasticbeanstalk:container:nodejs. Change the NodeVersion to 6.9.1 or one that the error message above suggests.
Save and quit.
After the configuration is complete:
Perform eb status to verify that your environment is using the upgraded Solution Stack.
You can clone the existing environment to a new one, using a different platform version.
In the Actions menu, select "Clone with the latest platform".
That opens a new page where you can select from available OS/nodejs versions.
Once you are satisfied with the new environment, you can swap URLs with the old one in order to replace it. After that, you can remove the older env.
This has happened a few times before when Amazon releases new Environments and they do not include versions in common between the environments. The solution is to set value for nodejs version to an empty string which means to use the latest version. It could break your app, but you can make a clone with latest platform and switch to desired version of nodejs later. So run this command to do that:
aws elasticbeanstalk update-environment --region "your region" --application-name "your app" --environment-name "your env" --option-settings "OptionName=NodeVersion,Namespace=aws:elasticbeanstalk:container:nodejs,Value=''"

How can i perform a build on ec2?

I have a fresh ec2 instance and im trying to install appscale tools and then appscale itself. When i go to do the build, i get an error says lsb_release: command not found.
Its my understanding that this command is pretty standard in linux. So is there a way to get ec2 to run it?

Resources