`eb config save`: The specified key does not exist - amazon-web-services

Why is it saving configuration is giving me S3 error?
The configuration is actually saved. I can see it in aws console:
and in the S3 bucket:
But not locally in .elasticbeanstalk/. What am I missing?

Double which application eb cli is using. The eb cli allows you to operate on Environment which are not part of the Application which is currently selected by the EB CLI. To fix it you can eb init again or change directory to a dir which has been initialized with the right application.
I realize I'm answer far too late to help with the original question, but I arrived here by google search, so I'm hoping to help someone further down the timestream.

Related

AWS elastic beanstalk configuration for rolling updates

Currently I'm trying to solve some mystery changing settings in an Elastic Beanstalk environment. I will try to explain the situation and what is happening.
We have a Jenkins server which we can command to create a build (artifact) to upload to an S3 bucket. The S3 bucket is watched by a cloudwatch event what will trigger a codepipeline and deploys the artifact to multiple ec2 instances.
Now on the EBS environment there are some settings, for example the rolling updates part. It seems that sometimes the DeploymentPolicy is 'magically' updated from rolling to allAtOnce. Me and my colleagues don't understand how this setting is changed, because no-one touches this part of the gui.
I've tried putting these settings into config files, but that didn't work out so well. I tried adding a env.yaml in the project root. The EBS is reading this file, but I get errors that the syntax is incorrect. I tried following this document, but I can't get it to work.
https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/environment-cfg-manifest.html
Also I tried adding a file in .ebextensions/rolling_updates.config with the following content:
option_settings:
aws:elasticbeanstalk:command:
BatchSizeType: Percentage
DeploymentPolicy: Immutable
But that also didn't work. (I tried some other values just to check if the update worked)
Is there somebody who has done this before and can help me explain what I should do to fix this?
One thought that has crossed my mind is putting a config file in an S3 bucket and install AWS-cli on the Jenkins server. Then every deployment we can update the EBS config before uploading the artifact to S3. But I'm not sure that's a correct approach as well.
Thanks all!

How to Implement Blue-Green deployment on Elastic Beanstalk environment using CICD

I am trying to implement the Blue-Green deployment using the CICD pipeline. I am following this guide here:
https://aws-quickstart.s3.amazonaws.com/quickstart-codepipeline-bluegreen-deployment/doc/blue-green-deployments-to-aws-elastic-beanstalk-on-the-aws-cloud.pdf
Now in this guide on page 16, it is saying to launch the CF template. Then we have to enter some parameters after uploading the template. I am right now using the sample PHP application of aws which is zipped and stored in one of my S3 bucket. Parameters are following:
Here elb-blue-green-sample is my bucket where the sample PHP application is zipped and stored. Beanstalk Source Stage S3 Bucket key is pointing to the PHP zip file in my bucket. Every else parameter I keeping blank as they are optional and CF will create it on its own.
Now when I launch this template it is showing following error and is then Rollbacking:
Please help me to implement if somebody has implemented it or have any experience as I am stuck here and do not know where I am understanding it wrong.
Thanks in Advance
In your case, the Beanstalk Source Stage S3 Bucket key will be just:
php-v1 (1).zip

How to automate the code from Bitbucket to Amazon Ec2 Instance

I want to automate the process by which when I push my code to my private repository on Bitbucket, it will directly update on my EC2 Instances. For that I gained some knowledge which was like:
AWS CodeDeploy is used for that. What I have learned is:
Go to IAM Role and create the role and attach the policy i.e AmazonEC2RoleForCodeDeploy & AWSCodeDeployRole
Edit Trust Relationship -> "service": "codedeploy.amazonaws.com"
At the time of the creation of EC2 Instance use the IAM Role to the role which we just created.
But I am confused about the YML code which will be paste on Advance Details (at the time of Instance Creation).
I attended many Blogs and youtube tutorials but getting confused about the right implementation.
On some tutorial, used S3 for code deploy. I am a little confused about this problem regarding the automation process.
My simple requirement is When I update/push the code on my personal branch, it will update on my directory which is under my EC2 instance.
Any AWS expert or DevOps will help me with that, Kindly share the best efficient manner to achieve this task. I am Mentioning "expert" because I need the best and optimum solution not the solution to achieve the goal.
Any help or suggestion is really appreciated for that. Pardon me if there is some typo error or any grammatical error on mine query.
The basic steps would be:
Add the CodeDeploy addon from from Bitbucket's App Marketplace and
configure it.
To add an IAM role that allows Bitbucket to first push code to an
intermediate S3 bucket in your account.
Once you've configured the CodeDeploy settings from the Settings
page of the Bitbucket console, you can perform a deployment to the
Deployment group from your branch and monitor this in the Codedeploy
console.
The blog below has clear and detailed steps for this:
https://aws.amazon.com/blogs/apn/announcing-atlassian-bitbucket-support-for-aws-codedeploy/
The Yaml file you are confused about is the Appspec file that tells CodeDeploy what actions to perform during a Deployment.
The bare minimum appspec.yml file you can have to deploy all the files from the source package:
version: 0.0
os: linux
files:
- source: /
destination: /var/www/html
This file is placed in the root of your source code.
Appspec file example:
https://docs.aws.amazon.com/codedeploy/latest/userguide/reference-appspec-file-example.html#appspec-file-example-server

How to view differences between config file and real resources

i've created a kubernetes cluster using kops and its config file in S3.
The problem is that i've modified some resources manually (such as ec2 properties).
I would like to know if there is some way to view the changes i've made manually.
Hope you can help me.
Considering that you have used AWS config service for auditing the configurations of your AWS resources, you can view the changes either by AWS Config console or by using AWS CLI.
Please refer Viewing Configuration Details to see the required changes.
The way I do this is kops
terraform output https://github.com/kubernetes/kops/blob/master/docs/terraform.md (--target=terraform flag). Then
Create a cluster via terraform
Do smth manually
Run terraform plan. This will show the diff between current and config. Either hit apply to revert manual changes, or code manual changes and re-apply.
Try kubediff from weaveworks.
https://github.com/weaveworks/kubediff

Deploying failed in AWS Elasticbeanstalk

I have a problem in deploying PHP based web application in AWS EB. I tried to push files using GIT bash; it went fine and shows completed 100%.
Then I checked in my AWS console it shows "Environment update is starting." after few seconds it shows
"Service:AmazonCloudFormation, Message:Stack:arn:aws:cloudformation:us-east-1:556003586595:stack/awseb-e-m3tbtwpcpe-stack/0bb57070-5fac-11e2-af2e-5081b23f0c86 is in UPDATE_ROLLBACK_FAILED state and can not be updated."
"Failed to deploy application."
Please help someone how to resolve this issue. I am in urgency of setting the web application in AWS EB as soon as possible.
Thanks in advance,
Sankar.
Have you tried rebuilding the environment from the AWS Console? Are you doing anything less common like running your Beanstalk environment inside of a VPC?