AWS CodeDeploy Error Handling

Can use the AWS CodeDeploy console, the AWS CLI, or the AWS CodeDeploy API to view details about deployment associated with an AWS account.

/opt/codedeploy-agent/deployment-root/deployment-logs/codedeploy-agent-deployments.log

To view the deployment details using the AWS CLI, invoke the get-deployment command or the batch-get-deployments command to get a list of unique deploy IDs to use as input to the get-deployment and batch-get-deployments commands.

Is it better to acquire the execution log of codedeploy as devops thinking?

Writing automatic configuration script, PAC file

In the PAC file, describe the processing condition for specifying the proxy server to use based on the information such as the URL of the access destination. Within script processing, it returns the destination(URL or IP address) and port number of the proxy server matching the condition such as the host name of the URL and the IP address.

PAC file sample

function FindProxyForURL(url, host){
  if(isPlainHostName(host)){
    return "DIRECT";
  } else {
    if (shExpMatch(url, "http://www.bing.com/")){
      return "PROXY www.bing-proxy.com:6060";
    } else if (shExpMatch(url, "http://www.microsoft.com/")){
      return "PROXY www.microsoft-proxy.com:7070";
    } else {
      return "PROXY www.other-proxy.com:8080"
    }
  }
}

Proxy server setting method of Windows 10

When browsing a web page on the internet, it may be set to access via a specific server. This server is called “Proxy server”. It can also be used for non-web access.

The main advantages of this setting are as follows.

Caching can be used when viewing the same web page from multiple personal computers.
(It is unnecessary for all the personal computers to acquire the same data, and the communication volume is reduced)
You can use the “filter” function of not accessing specific URLs.
It is possible to collectively record access histories of all personal computers.

Let’s see how to set “proxy server” on Windows 10.

Open setting and chose network and internet.

Here you can see proxy.

Use setup script
use automatic configuration script
Just specify the location of the PAC file. In what cases proxy to use is described in the PAC file (programming language, a file written in JavaScript)

Specify the URL of the PAC file
Manual proxy set up
specify your own proxy server(specify address and port)
setting method
specify the proxy server address and port number

What is “Proxy Server”

A proxy server is a server that connects to the Internet on behalf of a computer that can not directly connect to the Internet, and represents a server that act on behalf of access to a Web site, and a proxy mean substitute when translated into.

The corporate in-house LAN has a firewall setting to protect the connected computer from malicious external access, but in this state, since you can not access the website from the inside of the company, a proxy serve is putting on.

function
1. cache
2. filtering
3. ensure anonymity

CodeDeploy Appspec.yml

AppSpec
AppSpec is the contents of the deployment process executed by AWS CodeDeploy. It is a file composed of YAML format that describes specific contents, what kind of things to handle in the deployment. In using CodeDeploy, it is very important to specify what are to be set in AppSpec.

The name of the AppSpec file must be appspec.yml and be placed in the root directory. If this requirement is not met, the deployment fails. Also, if there is an AppSpec file, you can make the deployment content including it into a compressed file in Zip.

file composition

version: 0.0
os: operating-system-name
files:
  source-destination-files-mappings
permissions:
  permissions-specifications
hooks:
  deployment-lifecycle-event-mappings

start -> applicationstop -> downloadbundle -> beforeinstall -> install -> afterinstall -> applicationstart -> validateservice -> end

How to create Code deploy

CodeDeploy → Create role for EC2
Enable CodeDeploy to access the EC2
instance to be deployed, select “AWS service” and “CodeDeploy”

Open IAM Manager on the AWS console and select “role” link text below.

Search “CodeDeploy” with the role page and put checkbox.

Create role and review

create application

We can chose application type, in-place or green/blue.

AWS Glacier

Let’s have a look at AWS Glacier

– Very low cost
– Storage service suitable for archiving data
– It is suitable for data that does not cause hindrance even when it takes time to take out and data that is not frequently accessed
– It is suitable for the case to be adopted as a replacement for conventional tape backup

It is said storage for backup.

To upload data such as photos, videos and other documents, need to use the AWS CLI. Althernatively, need to write code to make the upload request either directly using REST API or using the AWS SDK.

Amazon Glacier’s data is managed in units called Valut. Up to 1000 valuts can be created for each region, and up to 40 TB can be saved per Valut.

– Do not enable notification

As a concept feel like S3.

backup and recovery approach using AWS

Durability
Use 99.999999999% durability of safe storage of data provided by Amazon S3.

Security
Use flexible access control applicable to data transfer and storage and various encryption options.

Global infrastructure
Since it can be used all over the world, will use regions that comply with organization’s compliance requirements, local laws and regulations, standards etc.

Compliance
Since AWS complies with various security standards around the world including SOC, ISO 27001, PCI DSS, etc., it is possible to easily match the backup mechanism to existing compliance standards.

Scalability
Since a storage area that automatically changes according to the size of the backup data is provided, there is no need to manage the storage capacity

Reduced TCO
By using full managed services, operation costs are reduced, leading to a reduction in the total cost of ownership(TCO) of backup storage.

Price based on metered basis
Since it is a usage fee based on the used capacity and duration, a life cycle plan is set so that only data necessary for backup and recovery plan is saved.

The features of “classmethod”

https://classmethod.jp/

Described on the homepage that aws professional group solves the problem.

When examining company information, first of all it is a habit to see employment information.

First view shows project manager, aws integration.

Job detail
What kind of work do you do?
As a project manager, we will do project promotion in general. We will promote a series of work such as progress management and quality control from the planning and agreement of the project with the engineers and partners in the company.

Also, for customers who have already installed AWS, as an account manager as well as sales, we think about further use of AWS to solve problems of customers and solve business problems, and we will help you decide policy.

What kind of human resources are you looking for?
Those who have a strong will to make the project successful with customers. If problems occur, do not hold them alone, those who can deal with organizations and team involvement.

Wow, what engineer are doing is roughly the same with other places.

AWS operational design consultant
– Operational design work of service built by our company or customer
– Proposal of labor saving, automation by combining various services of AWS
– Support for operational design in order to acquire certification of our company or customer service.

With aws design, you have to understand aws in a great deal of detail.

Is not it listed? want to invest lol

AWS codedeploy

CodeDeploy is a managed service of AWS and can deploy source code and build artifacts for EC2 and on-premises servers and Lambda.

You can choose between in-place deployment and Blue / Green deployment to deploy to EC2 and on-premises servers.

You can select the source of the distribution from S3 and GitHub, but it will inevitably become s3 because the extension must be zip, tar, and tar.gz.

It is appsepec.yml that determines the rules for these deployment. Either type of appspeck.yml is required.

First of all, the content of the sample.zip file being uploaded to s3 are as follows. Assume that sample.jar is already built and star.sh describes the command to start it.

sample.zip
├── appspec.yml
├── sample.jar
└── start.sh