How to see the deployment progress via aws cli - amazon-web-services

I created a deployment using AWS cli:
aws deploy create-deployment --application-name systest1 --deployment-group-name TEST --s3-location bucket=artifacts,bundleType=zip,key=APP.zip
and I got the out as
{
"deploymentId": "d-559F8S41O"
}
How can I see the status of the deployment?? I believe
aws deploy get-deployment
will show us the status but it will not show continuous progress. Actually, I am using AWS cli so use don't have to go on AWS console and check the deployment status instead he will get the result on gitlab-ci output only. Any suggestion??

Use the below CLI command to get the status:
aws deploy get-deployment --deployment-id d-52EZVE6PC --query "deploymentInfo.[status, creator]" --output text

Related

How to run codepipeline from AWS chatbot

I'm trying to run AWS codepipeline from slack using AWS chatbot feature. I've configured a chatbot properly and it is giving me appropriate response when I'm running a command
#aws codepipeline list-pipelines --region us-east-1
With this command it is showing me all the configured codepipelines in my AWS account.
However when I'm trying to run a pipeline using
#aws codepipeline start-pipeline-execution --name dev-pipeline
I'm getting following error.
I can't run the command codepipeline start-pipeline-execution because it isn't enabled.
There's no option I can see in AWS Chatbot to enable this pipeline.
I'm able to run this same pipeline using AWS CLI and its working perfectly fine.
Can someone please give me any pointer to configure AWS Chatbot from Slack to run AWS Codepipeline?

In the elastic beanstalk, I get the message 'Service: Amazon S3, Message: Forbidden'

My eb is currently on the docker platform and will read the Dockerrun.aws.json file on s3.
There is no problem when deploying from the web console, but deploying in the cli environment with the following command fails with the Service: Amazon S3, Message: Forbidden event log.
aws elasticbeanstalk update-environment --region [REGION] --environment-name [ENVIRONMENT_NAME] --version-label [VERSION_LABEL]
Also CloudTrail does not have any error code..
How can I fix it?

AWS CLI get status of deployment after deploying to elastic beanstalk

The last line of my deployment task using the AWS CLI is
aws elasticbeanstalk update-environment --application-name DevApi --environment-name Dev --version-label v2
How can I check that the deployment of v2 was successful? At the moment I have another browser window open console.aws.amazon.com/elasticbeanstalk/ and check there. But there has to be a better way to automate it as part of my deployment by adding another step (cli command?) so I only need to check the deployment output?
EDIT: I should also mention I am running a Windows Elastic Beanstalk instance.
One way I can think of is to check the EBS Health Reports.
If you are using Basic Monitoring, use the below cli:
aws elasticbeanstalk describe-environments --application-name DevApi --environment-name Dev --query 'Environments[*].{Status: Status,Health: Health} --output json'
Sample output:
[
{
"Status": "Ready",
"Health": "Green"
}
]
For more info about each indicator, read Basic Health Reporting.
If you are using Enhanced Monitoring (for extra cost), then there is an additional parameter available which makes it much more clear.
aws elasticbeanstalk describe-environments --application-name DevApi --environment-name Dev --query 'Environments[*].{Status: Status,Health: Health,HealthStatus: HealthStatus} --output json'
Sample Output:
[
{
"Status": "Ready",
"HealthStatus": "Ok",
"Health": "Green"
}
]
Once the above status is reached, you can conclude the deployment is complete and is healthy.
If the HealthStatus is Info and Health is Green, It indicates An operation is in progress on an instance (or) on several instances in an environment. Example: A new application version is being deployed to running instances.
For more info about each health indicator, do read Enhanced Health reporting.

AWS CodeDeploy - Error deploying - ApplicationDoesNotExistException

I want to deploy a project in AWS using :
$ aws --region eu-central-1 deploy push --application-name DemoApp --s3-location s3://paquirrin-codedeploy/Project1.zip --ignore-hidden-file --source .
But I got this error:
A client error (ApplicationDoesNotExistException) occurred when calling the RegisterApplicationRevision operation: Applications not found for 289558260222
but the application exists:
$ aws deploy list-applications
{
"applications": [
"DemoApp"
]
}
and CodeDeploy agent is running
[root#ip-171-33-54-212 ~]# /etc/init.d/codedeploy-agent status
The AWS CodeDeploy agent is running as PID 2649
but I haven't found the folder deployment-root inside /opt/codedeploy-agent !
You are deploying to region eu-central-1. But you may not be listing the applications in eu-central-1 using following command:
aws deploy list-applications
Instead, use following command to ensure that application exists:
aws deploy list-applications --region eu-central-1

Why does setting triggers for CodeDeploy deployment group fail with InvalidTriggerConfigException?

I'm trying to set up triggers with awc cli.
According to documentation:
http://docs.aws.amazon.com/codedeploy/latest/userguide/how-to-notify-edit.html
http://docs.aws.amazon.com/codedeploy/latest/APIReference/API_UpdateDeploymentGroup.html
aws deploy update-deployment-group --application-name NAME --deployment-config-name CodeDeployDefault.OneAtATime --current-deployment-group-name TEST --trigger-configurations '[{"triggerName":"TEST-CD","triggerTargetArn":"my:arn","triggerEvents":["DEPLOYMENT_SUCCESS|DEPLOYMENT_FAILURE|INSTANCE_FAILURE"]}]'
aws deploy update-deployment-group --application-name NAME --deployment-config-name CodeDeployDefault.OneAtATime --current-deployment-group-name TEST --trigger-configurations '[{"triggerName":"TEST-CD","triggerTargetArn":"my:arn","triggerEvents":["DEPLOYMENT_SUCCESS"]}]'
aws deploy update-deployment-group --application-name NAME --deployment-config-name CodeDeployDefault.OneAtATime --current-deployment-group-name TEST --trigger-configurations '[{"triggerName":"TEST-CD","triggerTargetArn":"my:arn","triggerEvents":{"DEPLOYMENT_SUCCESS"}}]'
But i'm not able to do this. Reciving following errors:
A client error (InvalidTriggerConfigException) occurred when calling
the UpdateDeploymentGroup operation: Invalid Trigger event type
Here is how to do it properly:
https://forums.aws.amazon.com/thread.jspa?threadID=228103