This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#aws_access_key_id and aws_secret_access_key are displayed just once hence note down it safely | |
#Just sharing the AWS-GK :P | |
#For each user only Two times aws_secret_access_key can be created. | |
# /bin/bash createuser.sh create_user/delete_user | |
#!/bin/bash | |
set -euo pipefail | |
declare -r aws_profile="<value>" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variable "target_groups" { | |
type = list | |
default = ["xxx", "yyy"] #can be empty too | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#1. Script adds environment vraiables with the parameter_name as: /project/env/parameter_name | |
# hence change script variables as per need. | |
#2. Save environment variables within file named vars.txt | |
#3. environment variables and its values should be seperated by spaces and NOT = symbol | |
# ex: | |
# name1 val1 | |
# name2 val2 | |
#4. command line: ./AWS-param-store.sh {env} {add / delete} | |
########################################################################### |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: 0.2 | |
phases: | |
install: | |
commands: | |
runtime-versions: | |
java: openjdk11 | |
pre_build: | |
commands: | |
- echo Login to ECR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################################## | |
### ECSfargate | |
############################################################## | |
resource "aws_ecs_cluster" "hk-cluster-name" { | |
name ="ECR_cluster" | |
} | |
############################################################## | |
# Task definition for application to run | |
############################################################## |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################################## | |
# Once the image is build,run it inside your own private network | |
# (VPC) using Fargate | |
############################################################## | |
############################################################## | |
#Create VPC | |
############################################################## | |
resource "aws_vpc" "hk-vpc" { | |
cidr_block = "10.0.0.0/16" | |
tags = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################################## | |
# Create a Role, attach policy to it. | |
#Allowing access to S3 and ECR aws resources | |
############################################################## | |
resource "aws_iam_role" "codebuild-role" { | |
name = "codebuild-role" | |
assume_role_policy = <<EOF | |
{ | |
"Version": "2012-10-17", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################################## | |
#create codeuild. | |
#define the right environment variables. | |
# Set the environment varaibles based on variable in .yml file | |
############################################################## | |
resource "aws_codebuild_project" "codebuild" { | |
name = "codebuild_project" | |
description = "codebuild to build java application push artifacts to s3 output bucket and docker image to ECR " | |
build_timeout = "5" | |
service_role = "${aws_iam_role.codebuild-role.name}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Use aws provider and IAM User "name" | |
provider "aws" { | |
profile = "name" | |
region = "eu-west-2" | |
} | |
// | |
############################################################## | |
# Create S3 input bucket for storing application in zip format. | |
############################################################## |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# All Vagrant configuration is done below. The "2" in Vagrant.configure | |
# configures the configuration version (we support older styles for | |
# backwards compatibility). Please don't change it unless you know what | |
# you're doing. | |
Vagrant.configure("2") do |config| | |
# The most common configuration options are documented and commented below. | |
# For a complete reference, please see the online documentation at |