Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add cloudwatch config. package config.json into circleci upload to s3 #12

Merged
merged 3 commits into from
Mar 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ jobs:
mkdir -p codedeploy_artifact
cp infrastructure/aws/codedeploy/*.sh .
cp infrastructure/aws/codedeploy/*.sql .
zip -r csye6225-web-app-${CIRCLE_BUILD_NUM}.zip webapp/csye6225/target/csye6225-0.0.1-SNAPSHOT.jar *.sh *.yml *sql
cp infrastructure/aws/codedeploy/*.json .
zip -r csye6225-web-app-${CIRCLE_BUILD_NUM}.zip webapp/csye6225/target/csye6225-0.0.1-SNAPSHOT.jar *.sh *.yml *sql *json
mv csye6225-web-app-${CIRCLE_BUILD_NUM}.zip codedeploy_artifact/
cd codedeploy_artifact
ls -al
Expand Down
12 changes: 8 additions & 4 deletions infrastructure/aws/cloudformation/csye6225-cf-cicd.json
Original file line number Diff line number Diff line change
Expand Up @@ -188,17 +188,21 @@
"Action": [ "sts:AssumeRole" ]
} ] },
"Path": "/",
"ManagedPolicyArns": [ {"Ref": "CodeDeployEC2S3" }]
"ManagedPolicyArns": [
{"Ref": "CodeDeployEC2S3" },
"arn:aws:iam::aws:policy/CloudWatchAgentServerPolicy",
"arn:aws:iam::aws:policy/service-role/AmazonEC2RoleforSSM"
]
}
},

"EC2InstanceProfile": {
"Type": "AWS::IAM::InstanceProfile",
"Properties": {
"Path": "/",
"Roles": [ {
"Ref": "CodeDeployEC2ServiceRole"
} ],
"Roles": [
{ "Ref": "CodeDeployEC2ServiceRole"}
],
"InstanceProfileName": "EC2InstanceProfile"
}
},
Expand Down
20 changes: 20 additions & 0 deletions infrastructure/aws/codedeploy/cloudwatch-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"agent": {
"metrics_collection_interval": 10,
"logfile": "/var/logs/amazon-cloudwatch-agent.log"
},
"logs": {
"logs_collected": {
"files": {
"collect_list": [
{
"file_path": "/opt/tomcat/logs/csye6225.log",
"log_group_name": "csye6225_spring2019",
"log_stream_name": "webapp"
}
]
}
},
"log_stream_name": "cloudwatch_log_stream"
}
}