├── commands └── terraform.v12 ├── AWS_Client_VPN ├── aws_client_vpn │ ├── environment │ │ └── dev │ │ │ ├── main.tf │ │ │ ├── tls.sh │ │ │ ├── variables.tf │ │ │ └── versions.tf │ └── modules │ │ ├── aws-client-vpn │ │ ├── main.tf │ │ ├── output.tf │ │ └── variables.tf │ │ ├── aws-vpc │ │ ├── main.tf │ │ ├── output.tf │ │ └── variables.tf │ │ ├── aws_simple_AD │ │ ├── main.tf │ │ ├── output.tf │ │ └── variables.tf │ │ └── terraform-label │ │ ├── main.tf │ │ ├── outputs.tf │ │ └── variables.tf └── learning │ ├── Simple-AD │ ├── Simple-AD-1.PNG │ ├── Simple-AD-2.PNG │ └── Simple-AD-3.PNG │ └── aws-client-vpn-theory │ ├── aws-client-vpn-1.jpeg │ ├── aws-client-vpn-2.jpeg │ ├── aws-client-vpn-3.jpeg │ └── aws-client-vpn-4.jpeg ├── AWS_Hashicorp_Vault └── vpc+vault-ec2 │ ├── Terraform Important Commands.txt │ └── aws │ ├── environment │ └── dev │ │ ├── extra-scripts │ │ └── delete-roles-policy-instance-profiles.sh │ │ ├── main.tf │ │ ├── openvpn │ │ ├── openvpn-addtional-users.sh │ │ └── openvpn.sh │ │ ├── step-1 │ │ └── openvpn.sh │ │ ├── step-2 │ │ ├── tls-A.sh │ │ ├── vault-master-C.sh │ │ └── vault-role-for-ec2-B.sh │ │ ├── step-3 │ │ ├── Note-A-TLS-MUST-BE-THE-SAME-CA-FROM-MASTER.txt │ │ ├── failOver-C.sh │ │ └── vault-role-for-ec2-B.sh │ │ ├── variables.tf │ │ └── versions.tf │ └── modules │ ├── aws-dynamodb │ ├── main.tf │ └── variables.tf │ ├── aws-ec2-keypair │ ├── main.tf │ ├── output.tf │ ├── variable.tf │ └── versions.tf │ ├── aws-ec2 │ ├── main.tf │ ├── outputs.tf │ ├── user-data │ │ └── user-data.sh │ └── variables.tf │ ├── aws-eip │ └── openvpn │ │ ├── main.tf │ │ ├── output.tf │ │ └── variables.tf │ ├── aws-rds-mysql │ ├── main.tf │ ├── output.tf │ └── variables.tf │ ├── aws-sg-cidr-v2 │ ├── maint.tf │ ├── output.tf │ └── variable.tf │ ├── aws-sg-cidr │ ├── main.tf │ ├── output.tf │ └── variable.tf │ ├── aws-sg-ref-v2 │ ├── main.tf │ ├── output.tf │ └── variable.tf │ ├── aws-sg-ref │ ├── main.tf │ ├── output.tf │ └── variable.tf │ ├── aws-sg-requirement │ ├── main.tf │ ├── output.tf │ └── variable.tf │ ├── aws-vpc │ ├── main.tf │ ├── output.tf │ └── variables.tf │ ├── secrets │ ├── vault-demo │ ├── vault-demo.pub │ ├── vault-failover │ ├── vault-failover.pub │ ├── vault-master │ └── vault-master.pub │ └── terraform-label │ ├── main.tf │ ├── outputs.tf │ └── variables.tf ├── CloudFront ├── environment │ └── dev │ │ ├── main.tf │ │ ├── output.tf │ │ ├── s3-bucket.sh │ │ └── webapp │ │ └── index.html └── modules │ └── cloudfront │ ├── main.tf │ ├── output.tf │ └── variables.tf ├── RDS_wordpress_docker ├── environment │ └── dev │ │ ├── kms-ec2-role.sh │ │ ├── kms-encryption.sh │ │ ├── main.tf │ │ ├── variables.tf │ │ ├── versions.tf │ │ └── wordpress-with-rds.sh └── modules │ ├── aws-dynamodb │ ├── main.tf │ └── variables.tf │ ├── aws-ec2-keypair │ ├── main.tf │ ├── output.tf │ ├── variable.tf │ └── versions.tf │ ├── aws-ec2 │ ├── main.tf │ ├── outputs.tf │ ├── user-data │ │ └── user-data.sh │ └── variables.tf │ ├── aws-eip │ └── docker │ │ ├── main.tf │ │ ├── output.tf │ │ └── variables.tf │ ├── aws-kms │ ├── main.tf │ └── variables.tf │ ├── aws-rds-mysql │ ├── main.tf │ ├── output.tf │ └── variables.tf │ ├── aws-sg-cidr-v2 │ ├── maint.tf │ ├── output.tf │ └── variable.tf │ ├── aws-sg-cidr │ ├── main.tf │ ├── output.tf │ └── variable.tf │ ├── aws-sg-ref-v2 │ ├── main.tf │ ├── output.tf │ └── variable.tf │ ├── aws-sg-ref │ ├── main.tf │ ├── output.tf │ └── variable.tf │ ├── aws-sg-requirement │ ├── main.tf │ ├── output.tf │ └── variable.tf │ ├── aws-vpc │ ├── main.tf │ ├── output.tf │ └── variables.tf │ ├── secrets │ ├── docker-demo │ ├── docker-demo.pub │ ├── vault-demo │ ├── vault-demo.pub │ ├── vault-failover │ ├── vault-failover.pub │ ├── vault-master │ └── vault-master.pub │ └── terraform-label │ ├── main.tf │ ├── outputs.tf │ └── variables.tf ├── SSM-port-forward ├── aws-nuke ├── aws-rds ├── environment │ └── dev │ │ ├── main.tf │ │ ├── variables.tf │ │ └── versions.tf └── modules │ ├── aws-cgw │ ├── main.tf │ ├── output.tf │ └── variable.tf │ ├── aws-ec2-keypair │ ├── main.tf │ ├── output.tf │ ├── variable.tf │ └── versions.tf │ ├── aws-ec2 │ ├── main.tf │ ├── outputs.tf │ ├── user-data │ │ └── user-data.sh │ └── variables.tf │ ├── aws-iam-role │ ├── main.tf │ ├── output.tf │ └── variable.tf │ ├── aws-iam-user │ ├── main.tf │ ├── output.tf │ ├── variables.tf │ └── versions.tf │ ├── aws-instance-profile │ ├── main.tf │ ├── output.tf │ └── variables.tf │ ├── aws-kms │ ├── main.tf │ ├── output.tf │ └── variables.tf │ ├── aws-policies │ ├── ec2-secret-manager-policy.json │ ├── iam-user-s3-policy.json │ └── s3-policy-one.json │ ├── aws-rds-mysql │ ├── main.tf │ ├── output.tf │ └── variables.tf │ ├── aws-secret-manager │ ├── main.tf │ └── variable.tf │ ├── aws-sg-cidr-v2 │ ├── maint.tf │ ├── output.tf │ └── variable.tf │ ├── aws-sg-cidr │ ├── main.tf │ ├── output.tf │ └── variable.tf │ ├── aws-sg-ref-v2 │ ├── main.tf │ ├── output.tf │ └── variable.tf │ ├── aws-sg-ref │ ├── main.tf │ ├── output.tf │ └── variable.tf │ ├── aws-sg-requirement │ ├── main.tf │ ├── output.tf │ └── variable.tf │ ├── aws-vgw │ ├── main.tf │ ├── outputs.tf │ └── variables.tf │ ├── aws-vpc │ ├── environment │ │ └── dev │ │ │ ├── main.tf │ │ │ ├── variables.tf │ │ │ └── versions.tf │ ├── main.tf │ ├── modules │ │ ├── aws-vpc │ │ │ ├── main.tf │ │ │ ├── output.tf │ │ │ └── variables.tf │ │ └── terraform-label │ │ │ ├── main.tf │ │ │ ├── outputs.tf │ │ │ └── variables.tf │ ├── output.tf │ └── variables.tf │ ├── aws-vpn-connection │ ├── main.tf │ ├── output.tf │ └── variable.tf │ ├── secrets │ └── ec2-v12.pub │ └── terraform-label │ ├── main.tf │ ├── outputs.tf │ └── variables.tf ├── aws ├── environment │ └── dev │ │ ├── main.tf │ │ ├── variables.tf │ │ └── versions.tf └── modules │ ├── aws-cgw │ ├── main.tf │ ├── output.tf │ └── variable.tf │ ├── aws-ec2-keypair │ ├── main.tf │ ├── output.tf │ ├── variable.tf │ └── versions.tf │ ├── aws-ec2 │ ├── main.tf │ ├── outputs.tf │ ├── user-data │ │ └── user-data.sh │ └── variables.tf │ ├── aws-iam-role │ ├── main.tf │ ├── output.tf │ └── variable.tf │ ├── aws-iam-user │ ├── main.tf │ ├── output.tf │ ├── variables.tf │ └── versions.tf │ ├── aws-instance-profile │ ├── main.tf │ ├── output.tf │ └── variables.tf │ ├── aws-kms │ ├── main.tf │ ├── output.tf │ └── variables.tf │ ├── aws-policies │ ├── ec2-secret-manager-policy.json │ ├── iam-user-s3-policy.json │ └── s3-policy-one.json │ ├── aws-rds-mysql │ ├── main.tf │ ├── output.tf │ └── variables.tf │ ├── aws-secret-manager │ ├── main.tf │ └── variable.tf │ ├── aws-sg-cidr-v2 │ ├── maint.tf │ ├── output.tf │ └── variable.tf │ ├── aws-sg-cidr │ ├── main.tf │ ├── output.tf │ └── variable.tf │ ├── aws-sg-ref-v2 │ ├── main.tf │ ├── output.tf │ └── variable.tf │ ├── aws-sg-ref │ ├── main.tf │ ├── output.tf │ └── variable.tf │ ├── aws-sg-requirement │ ├── main.tf │ ├── output.tf │ └── variable.tf │ ├── aws-vgw │ ├── main.tf │ ├── outputs.tf │ └── variables.tf │ ├── aws-vpc │ ├── environment │ │ └── dev │ │ │ ├── main.tf │ │ │ ├── variables.tf │ │ │ └── versions.tf │ ├── main.tf │ ├── modules │ │ ├── aws-vpc │ │ │ ├── main.tf │ │ │ ├── output.tf │ │ │ └── variables.tf │ │ └── terraform-label │ │ │ ├── main.tf │ │ │ ├── outputs.tf │ │ │ └── variables.tf │ ├── output.tf │ └── variables.tf │ ├── aws-vpn-connection │ ├── main.tf │ ├── output.tf │ └── variable.tf │ ├── secrets │ └── ec2-v12.pub │ ├── terraform-label │ ├── main.tf │ ├── outputs.tf │ └── variables.tf │ └── vpc │ ├── main.tf │ ├── output.tf │ └── variables.tf ├── ec2-console-ssm ├── ecs-rds ├── environment │ └── dev │ │ ├── kms-ec2-role.sh │ │ ├── kms-encryption.sh │ │ ├── main.tf │ │ ├── variables.tf │ │ ├── versions.tf │ │ └── wordpress-with-rds.sh ├── modules │ ├── aws-dynamodb │ │ ├── main.tf │ │ └── variables.tf │ ├── aws-ec2-keypair │ │ ├── main.tf │ │ ├── output.tf │ │ ├── variable.tf │ │ └── versions.tf │ ├── aws-ec2 │ │ ├── main.tf │ │ ├── outputs.tf │ │ ├── user-data │ │ │ └── user-data.sh │ │ └── variables.tf │ ├── aws-eip │ │ └── docker │ │ │ ├── main.tf │ │ │ ├── output.tf │ │ │ └── variables.tf │ ├── aws-kms │ │ ├── main.tf │ │ └── variables.tf │ ├── aws-rds-mysql │ │ ├── main.tf │ │ ├── output.tf │ │ └── variables.tf │ ├── aws-sg-cidr-v2 │ │ ├── maint.tf │ │ ├── output.tf │ │ └── variable.tf │ ├── aws-sg-cidr │ │ ├── main.tf │ │ ├── output.tf │ │ └── variable.tf │ ├── aws-sg-ref-v2 │ │ ├── main.tf │ │ ├── output.tf │ │ └── variable.tf │ ├── aws-sg-ref │ │ ├── main.tf │ │ ├── output.tf │ │ └── variable.tf │ ├── aws-sg-requirement │ │ ├── main.tf │ │ ├── output.tf │ │ └── variable.tf │ ├── aws-vpc │ │ ├── main.tf │ │ ├── output.tf │ │ └── variables.tf │ ├── secrets │ │ ├── ecs │ │ └── ecs.pub │ └── terraform-label │ │ ├── main.tf │ │ ├── outputs.tf │ │ └── variables.tf └── secret_manager_&_parameter_store.txt ├── eks ├── eks-doc.txt ├── environment │ ├── dev │ │ ├── main.tf │ │ ├── outputs.tf │ │ └── versions.tf │ └── prod │ │ ├── main.tf │ │ ├── outputs.tf │ │ └── versions.tf ├── modules │ ├── eks-autoscale-group │ │ ├── autoscaling.tf │ │ ├── main.tf │ │ ├── outputs.tf │ │ ├── variables.tf │ │ └── versions.tf │ ├── eks-cluster-master │ │ ├── auth.tf │ │ ├── configmap-auth.yaml.tpl │ │ ├── main.tf │ │ ├── outputs.tf │ │ ├── variables.tf │ │ └── versions.tf │ ├── eks-cluster-workers │ │ ├── main.tf │ │ ├── outputs.tf │ │ ├── userdata.tpl │ │ ├── variables.tf │ │ └── versions.tf │ ├── labels │ │ ├── main.tf │ │ ├── outputs.tf │ │ └── variables.tf │ └── vpc │ │ ├── main.tf │ │ ├── output.tf │ │ └── variables.tf └── userdata-eks.txt ├── emr ├── main.tf ├── modules │ ├── emr │ │ ├── main.tf │ │ ├── outputs.tf │ │ └── variables.tf │ ├── iam │ │ ├── main.tf │ │ └── outputs.tf │ └── security │ │ ├── main.tf │ │ ├── outputs.tf │ │ └── variables.tf ├── outputs.tf ├── terraform emr.rar ├── terraform.tfvars └── variables.tf ├── terraform+eksctl+ingress ├── eks-alb-ingress-helm ├── eks.md ├── environment │ └── dev │ │ ├── additional-node-group-to-existing-cluster.sh │ │ ├── alb-ingress-helm.sh │ │ ├── alb-ingress.sh │ │ ├── eksctl.sh │ │ ├── main.tf │ │ └── output.tf ├── kubernetes-dashboard.sh ├── kubewatch-slack-notifications ├── modules │ ├── labels │ │ ├── main.tf │ │ ├── outputs.tf │ │ └── variables.tf │ └── vpc │ │ ├── main.tf │ │ ├── output.tf │ │ └── variables.tf └── terraform-vpc+eks+alb-ingress.zip ├── terraform-vpc+eks+alb-ingress ├── eks-doc.txt ├── eks.md ├── environment │ └── dev │ │ ├── alb-ingress.sh │ │ ├── alb_ingress_helm.sh │ │ ├── eks-alb-ingress-helm │ │ ├── iam-policy.json │ │ ├── main.tf │ │ └── outputs.tf ├── kubernetes-dashboard.sh ├── modules │ ├── aws-ec2-keypair │ │ ├── main.tf │ │ ├── output.tf │ │ ├── variable.tf │ │ └── versions.tf │ ├── eks-autoscale-group │ │ ├── autoscaling.tf │ │ ├── main.tf │ │ ├── outputs.tf │ │ ├── variables.tf │ │ └── versions.tf │ ├── eks-cluster-master │ │ ├── auth.tf │ │ ├── configmap-auth.yaml │ │ ├── configmap-auth.yaml.tpl │ │ ├── main.tf │ │ ├── outputs.tf │ │ ├── variables.tf │ │ └── versions.tf │ ├── eks-cluster-workers │ │ ├── main.tf │ │ ├── outputs.tf │ │ ├── userdata.tpl │ │ ├── variables.tf │ │ └── versions.tf │ ├── labels │ │ ├── main.tf │ │ ├── outputs.tf │ │ └── variables.tf │ ├── secrets │ │ ├── cloudelligent-eks │ │ └── cloudelligent-eks.pub │ └── vpc │ │ ├── main.tf │ │ ├── output.tf │ │ └── variables.tf ├── terraform-vpc+eks+alb-ingress.zip └── userdata-eks.txt ├── vpc+application-load-balancer-ec2-role-ec2-launch-template ├── environment │ └── dev │ │ ├── ec2-key-pair.tf │ │ ├── ec2-rabbitmq-role.tf │ │ ├── main.tf │ │ └── variables.tf └── modules │ ├── aws-alb-tg │ ├── main.tf │ ├── output.tf │ └── variables.tf │ ├── aws-alb │ ├── main.tf │ ├── output.tf │ └── variable.tf │ ├── aws-asg │ └── aws-ec2-lauch-template │ │ ├── main.tf │ │ ├── user-data.sh │ │ └── variables.tf │ ├── aws-ec2-key-pair │ ├── create-key-pair.sh │ ├── main.tf │ ├── rabbitmq.pub │ └── rabbitq.pem │ ├── aws-ec2-role │ └── main.tf │ ├── aws-sg-cidr-v2 │ ├── maint.tf │ ├── output.tf │ └── variable.tf │ ├── aws-sg-cidr │ ├── main.tf │ ├── output.tf │ └── variable.tf │ ├── aws-sg-ref-v2 │ ├── main.tf │ ├── output.tf │ └── variable.tf │ ├── aws-sg-ref │ ├── main.tf │ ├── output.tf │ └── variable.tf │ ├── aws-vpc │ ├── main.tf │ ├── output.tf │ └── variables.tf │ └── terraform-label │ ├── main.tf │ ├── outputs.tf │ └── variables.tf ├── vpc+application-load-balancer-ec2-role ├── environment │ └── dev │ │ ├── ec2-rabbitmq-role.tf │ │ ├── main.tf │ │ └── variables.tf └── modules │ ├── aws-alb-tg │ ├── main.tf │ ├── output.tf │ └── variables.tf │ ├── aws-alb │ ├── main.tf │ ├── output.tf │ └── variable.tf │ ├── aws-ec2-role │ └── main.tf │ ├── aws-sg-cidr-v2 │ ├── maint.tf │ ├── output.tf │ └── variable.tf │ ├── aws-sg-cidr │ ├── main.tf │ ├── output.tf │ └── variable.tf │ ├── aws-sg-ref-v2 │ ├── main.tf │ ├── output.tf │ └── variable.tf │ ├── aws-sg-ref │ ├── main.tf │ ├── output.tf │ └── variable.tf │ ├── aws-vpc │ ├── main.tf │ ├── output.tf │ └── variables.tf │ └── terraform-label │ ├── main.tf │ ├── outputs.tf │ └── variables.tf ├── vpc+application-load-balancer ├── environment │ └── dev │ │ ├── main.tf │ │ ├── variables.tf │ │ └── versions.tf └── modules │ ├── aws-alb-tg │ ├── main.tf │ ├── output.tf │ └── variables.tf │ ├── aws-alb │ ├── main.tf │ ├── output.tf │ └── variable.tf │ ├── aws-sg-cidr-v2 │ ├── maint.tf │ ├── output.tf │ └── variable.tf │ ├── aws-sg-cidr │ ├── main.tf │ ├── output.tf │ └── variable.tf │ ├── aws-sg-ref-v2 │ ├── main.tf │ ├── output.tf │ └── variable.tf │ ├── aws-sg-ref │ ├── main.tf │ ├── output.tf │ └── variable.tf │ ├── aws-vpc │ ├── main.tf │ ├── output.tf │ └── variables.tf │ └── terraform-label │ ├── main.tf │ ├── outputs.tf │ └── variables.tf ├── vpc+ec2-nodejs ├── Terraform Important Commands.txt └── aws │ ├── environment │ └── dev │ │ ├── main.tf │ │ ├── nodejs.sh │ │ ├── variables.tf │ │ └── versions.tf │ └── modules │ ├── aws-ec2-keypair │ ├── main.tf │ ├── output.tf │ └── variable.tf │ ├── aws-ec2 │ ├── main.tf │ ├── outputs.tf │ ├── user-data │ │ └── nodejs │ │ │ └── user-data.sh │ └── variables.tf │ ├── aws-sg-cidr-v2 │ ├── maint.tf │ ├── output.tf │ └── variable.tf │ ├── aws-sg-cidr │ ├── main.tf │ ├── output.tf │ └── variable.tf │ ├── aws-sg-ref-v2 │ ├── main.tf │ ├── output.tf │ └── variable.tf │ ├── aws-sg-ref │ ├── main.tf │ ├── output.tf │ └── variable.tf │ ├── aws-sg-requirement │ ├── main.tf │ ├── output.tf │ └── variable.tf │ ├── aws-vpc │ ├── main.tf │ ├── output.tf │ └── variables.tf │ ├── eip │ └── nodejs │ │ ├── main.tf │ │ ├── output.tf │ │ └── variables.tf │ ├── secrets │ ├── nodejs │ └── nodejs.pub │ └── terraform-label │ ├── main.tf │ ├── outputs.tf │ └── variables.tf ├── vpc+ec2-zabbix+ec2-grafana ├── Windows-PEM-Format-Requirement.txt ├── aws │ ├── environment │ │ └── dev │ │ │ ├── main.tf │ │ │ ├── variables.tf │ │ │ └── versions.tf │ └── modules │ │ ├── aws-ec2-keypair │ │ ├── main.tf │ │ ├── output.tf │ │ └── variable.tf │ │ ├── aws-ec2 │ │ ├── main.tf │ │ ├── outputs.tf │ │ ├── user-data │ │ │ ├── grafana │ │ │ │ └── user-data.sh │ │ │ └── zabbix │ │ │ │ └── user-data.sh │ │ └── variables.tf │ │ ├── aws-sg-cidr-v2 │ │ ├── maint.tf │ │ ├── output.tf │ │ └── variable.tf │ │ ├── aws-sg-cidr │ │ ├── main.tf │ │ ├── output.tf │ │ └── variable.tf │ │ ├── aws-sg-ref-v2 │ │ ├── main.tf │ │ ├── output.tf │ │ └── variable.tf │ │ ├── aws-sg-ref │ │ ├── main.tf │ │ ├── output.tf │ │ └── variable.tf │ │ ├── aws-sg-requirement │ │ ├── main.tf │ │ ├── output.tf │ │ └── variable.tf │ │ ├── aws-vpc │ │ ├── main.tf │ │ ├── output.tf │ │ └── variables.tf │ │ ├── eip │ │ ├── grafana │ │ │ ├── main.tf │ │ │ ├── output.tf │ │ │ └── variables.tf │ │ └── zabbix │ │ │ ├── main.tf │ │ │ ├── output.tf │ │ │ └── variables.tf │ │ ├── secrets │ │ ├── monitoring │ │ └── monitoring.pub │ │ └── terraform-label │ │ ├── main.tf │ │ ├── outputs.tf │ │ └── variables.tf ├── commands.txt ├── grafana-link-zabbix ├── key-pair │ └── monitoring ├── zabbix-agent-linux │ └── Zabbix-Agent.txt ├── zabbix-agent-windows │ ├── Windows Zabbix Installation Commands.txt │ ├── bin │ │ ├── zabbix_agentd.exe │ │ ├── zabbix_get.exe │ │ └── zabbix_sender.exe │ ├── conf │ │ └── zabbix_agentd.conf │ ├── zabbix │ │ ├── zabbix_agentd.conf │ │ └── zabbix_agentd.exe │ ├── zabbix_agent-4.4.5-windows-amd64-openssl.msi │ └── zabbix_agent-5.0.0-windows-amd64-openssl.zip └── zabbix-notes │ ├── Zabbix-Admin User & AWS-SES-Email-Configuration.txt │ ├── Zabbix-Agent.txt │ └── Zabbix-Features.txt ├── vpc+jenkins-ec2 ├── Terraform Important Commands.txt └── aws │ ├── environment │ └── dev │ │ ├── main.tf │ │ ├── variables.tf │ │ └── versions.tf │ └── modules │ ├── aws-ec2-keypair │ ├── main.tf │ ├── output.tf │ ├── variable.tf │ └── versions.tf │ ├── aws-ec2 │ ├── main.tf │ ├── outputs.tf │ ├── user-data │ │ └── user-data.sh │ └── variables.tf │ ├── aws-sg-cidr-v2 │ ├── maint.tf │ ├── output.tf │ └── variable.tf │ ├── aws-sg-cidr │ ├── main.tf │ ├── output.tf │ └── variable.tf │ ├── aws-sg-ref-v2 │ ├── main.tf │ ├── output.tf │ └── variable.tf │ ├── aws-sg-ref │ ├── main.tf │ ├── output.tf │ └── variable.tf │ ├── aws-sg-requirement │ ├── main.tf │ ├── output.tf │ └── variable.tf │ ├── aws-vpc │ ├── main.tf │ ├── output.tf │ └── variables.tf │ ├── eip │ └── jenkins │ │ ├── main.tf │ │ ├── output.tf │ │ └── variables.tf │ ├── secrets │ ├── jenkins-demo │ └── jenkins-demo.pub │ └── terraform-label │ ├── main.tf │ ├── outputs.tf │ └── variables.tf ├── vpc+tgw ├── environment │ ├── dev1 │ │ ├── versions.tf │ │ ├── vpc-1.tf │ │ └── vpc-2.tf │ └── dev3 │ │ ├── versions.tf │ │ ├── vpc-1.tf │ │ └── vpc-2.tf ├── modules │ ├── aws-ec2-keypair │ │ ├── main.tf │ │ ├── output.tf │ │ ├── variable.tf │ │ └── versions.tf │ ├── aws-ec2 │ │ ├── main.tf │ │ ├── outputs.tf │ │ ├── user-data │ │ │ └── user-data.sh │ │ └── variables.tf │ ├── aws-sg-cidr-v2 │ │ ├── maint.tf │ │ ├── output.tf │ │ └── variable.tf │ ├── aws-sg-cidr │ │ ├── main.tf │ │ ├── output.tf │ │ └── variable.tf │ ├── aws-sg-ref-v2 │ │ ├── main.tf │ │ ├── output.tf │ │ └── variable.tf │ ├── aws-sg-ref │ │ ├── main.tf │ │ ├── output.tf │ │ └── variable.tf │ ├── aws-sg-tgw │ │ ├── main.tf │ │ ├── output.tf │ │ └── variable.tf │ ├── aws-transit-gateway │ │ ├── main.tf │ │ ├── output.tf │ │ └── variables.tf │ ├── aws-trasit-gateway-addtional-attachments │ │ ├── main.tf │ │ └── variables.tf │ ├── aws-vpc │ │ ├── main.tf │ │ ├── output.tf │ │ └── variables.tf │ ├── eip │ │ └── transit-gateway │ │ │ ├── main.tf │ │ │ ├── output.tf │ │ │ └── variables.tf │ ├── secrets │ │ ├── transit-gateway │ │ ├── transit-gateway-home-vpc │ │ ├── transit-gateway-home-vpc.pub │ │ └── transit-gateway.pub │ └── terraform-label │ │ ├── main.tf │ │ ├── outputs.tf │ │ └── variables.tf ├── tgw-cf │ ├── TransitGateway-With-Attachments.yaml │ ├── TransitGateway.yaml │ ├── issues.txt │ ├── vpc-attached-with-tgw-with-out-rt-cidr.yaml │ └── vpc-with-automatic-tgw-attahment.yaml └── tgw-concept │ ├── TGW-Multiple-Region.png │ ├── environment │ ├── eu-central-1 │ │ └── vpc-1.tf │ ├── eu-west-1 │ │ └── vpc-1.tf │ └── us-east-1 │ │ ├── vpc-1 │ │ ├── ec2-console.tf │ │ └── vpc-1.tf │ │ ├── vpc-2 │ │ └── vpc-2.tf │ │ └── vpc-3 │ │ └── vpc-3.tf │ ├── modules │ ├── aws-ec2-keypair │ │ ├── main.tf │ │ ├── output.tf │ │ ├── variable.tf │ │ └── versions.tf │ ├── aws-ec2-role │ │ └── main.tf │ ├── aws-ec2 │ │ ├── main.tf │ │ ├── outputs.tf │ │ ├── user-data │ │ │ └── user-data.sh │ │ └── variables.tf │ ├── aws-sg-cidr-v2 │ │ ├── maint.tf │ │ ├── output.tf │ │ └── variable.tf │ ├── aws-sg-cidr │ │ ├── main.tf │ │ ├── output.tf │ │ └── variable.tf │ ├── aws-sg-ref-v2 │ │ ├── main.tf │ │ ├── output.tf │ │ └── variable.tf │ ├── aws-sg-ref │ │ ├── main.tf │ │ ├── output.tf │ │ └── variable.tf │ ├── aws-sg-tgw │ │ ├── main.tf │ │ ├── output.tf │ │ └── variable.tf │ ├── aws-vpc │ │ ├── main.tf │ │ ├── output.tf │ │ └── variables.tf │ ├── eip │ │ └── transit-gateway │ │ │ ├── main.tf │ │ │ ├── output.tf │ │ │ └── variables.tf │ ├── secrets │ │ ├── transit-gateway │ │ └── transit-gateway.pub │ └── terraform-label │ │ ├── main.tf │ │ ├── outputs.tf │ │ └── variables.tf │ └── tgw-cf │ ├── TransitGateway-With-Attachments.yaml │ ├── TransitGateway.yaml │ ├── issues.txt │ ├── vpc-attached-with-tgw-with-out-rt-cidr.yaml │ └── vpc-with-automatic-tgw-attahment.yaml ├── vpc+windows ├── Terraform Important Commands.txt └── aws │ ├── environment │ └── dev │ │ ├── main.tf │ │ ├── variables.tf │ │ └── versions.tf │ └── modules │ ├── aws-ec2-keypair │ ├── main.tf │ ├── output.tf │ └── variable.tf │ ├── aws-ec2 │ ├── main.tf │ ├── outputs.tf │ ├── user-data │ │ └── windows │ │ │ └── user-data │ └── variables.tf │ ├── aws-sg-cidr-v2 │ ├── maint.tf │ ├── output.tf │ └── variable.tf │ ├── aws-sg-cidr │ ├── main.tf │ ├── output.tf │ └── variable.tf │ ├── aws-sg-ref-v2 │ ├── main.tf │ ├── output.tf │ └── variable.tf │ ├── aws-sg-ref │ ├── main.tf │ ├── output.tf │ └── variable.tf │ ├── aws-sg-requirement │ ├── main.tf │ ├── output.tf │ └── variable.tf │ ├── aws-vpc │ ├── main.tf │ ├── output.tf │ └── variables.tf │ ├── eip │ └── wordpress │ │ ├── main.tf │ │ ├── output.tf │ │ └── variables.tf │ ├── secrets │ ├── windows │ └── windows.pub │ └── terraform-label │ ├── main.tf │ ├── outputs.tf │ └── variables.tf ├── vpc+wordpress-ec2 ├── Terraform Important Commands.txt └── aws │ ├── environment │ └── dev │ │ ├── main.tf │ │ ├── plugin │ │ ├── all-in-one-wp-migration-file-extension.zip │ │ └── all-in-one-wp-migration-file-extension │ │ │ ├── all-in-one-wp-migration-file-extension.php │ │ │ ├── changelog.txt │ │ │ ├── constants.php │ │ │ ├── lib │ │ │ ├── controller │ │ │ │ ├── class-ai1wmte-import-controller.php │ │ │ │ └── class-ai1wmte-main-controller.php │ │ │ └── view │ │ │ │ ├── assets │ │ │ │ └── javascript │ │ │ │ │ └── uploader.min.js │ │ │ │ └── import │ │ │ │ └── pro.php │ │ │ ├── loader.php │ │ │ └── readme.txt │ │ ├── variables.tf │ │ └── versions.tf │ └── modules │ ├── aws-ec2-keypair │ ├── main.tf │ ├── output.tf │ └── variable.tf │ ├── aws-ec2 │ ├── main.tf │ ├── outputs.tf │ ├── user-data │ │ └── wordpress │ │ │ └── user-data.sh │ └── variables.tf │ ├── aws-sg-cidr-v2 │ ├── maint.tf │ ├── output.tf │ └── variable.tf │ ├── aws-sg-cidr │ ├── main.tf │ ├── output.tf │ └── variable.tf │ ├── aws-sg-ref-v2 │ ├── main.tf │ ├── output.tf │ └── variable.tf │ ├── aws-sg-ref │ ├── main.tf │ ├── output.tf │ └── variable.tf │ ├── aws-sg-requirement │ ├── main.tf │ ├── output.tf │ └── variable.tf │ ├── aws-vpc │ ├── main.tf │ ├── output.tf │ └── variables.tf │ ├── eip │ └── wordpress │ │ ├── main.tf │ │ ├── output.tf │ │ └── variables.tf │ ├── secrets │ ├── wordpress │ └── wordpress.pub │ └── terraform-label │ ├── main.tf │ ├── outputs.tf │ └── variables.tf ├── vpc-ansible-ec2-controller-+-managed-nodes ├── Terraform Important Commands.txt └── aws │ ├── environment │ └── dev │ │ ├── ec2-console.tf │ │ ├── main.tf │ │ └── variables.tf │ └── modules │ ├── aws-ec2-keypair │ ├── main.tf │ ├── output.tf │ └── variable.tf │ ├── aws-ec2 │ ├── main.tf │ ├── outputs.tf │ ├── user-data │ │ └── ansible │ │ │ ├── ansible-master.sh │ │ │ └── ansible-slave.sh │ └── variables.tf │ ├── aws-sg-cidr-v2 │ ├── maint.tf │ ├── output.tf │ └── variable.tf │ ├── aws-sg-cidr │ ├── main.tf │ ├── output.tf │ └── variable.tf │ ├── aws-sg-ref-v2 │ ├── main.tf │ ├── output.tf │ └── variable.tf │ ├── aws-sg-ref │ ├── main.tf │ ├── output.tf │ └── variable.tf │ ├── aws-sg-requirement │ ├── main.tf │ ├── output.tf │ └── variable.tf │ ├── aws-vpc │ ├── main.tf │ ├── output.tf │ └── variables.tf │ ├── eip │ └── ansible │ │ ├── main.tf │ │ ├── output.tf │ │ └── variables.tf │ ├── secrets │ ├── ansible │ └── ansible.pub │ └── terraform-label │ ├── main.tf │ ├── outputs.tf │ └── variables.tf ├── vpc-netflix-eureka-server ├── Terraform Important Commands.txt └── aws │ ├── environment │ └── dev │ │ ├── main.tf │ │ ├── route53-ha │ │ ├── variables.tf │ │ └── versions.tf │ └── modules │ ├── aws-ec2-keypair │ ├── main.tf │ ├── output.tf │ ├── variable.tf │ └── versions.tf │ ├── aws-ec2 │ ├── main.tf │ ├── outputs.tf │ ├── user-data │ │ └── user-data.sh │ └── variables.tf │ ├── aws-sg-cidr-v2 │ ├── maint.tf │ ├── output.tf │ └── variable.tf │ ├── aws-sg-cidr │ ├── main.tf │ ├── output.tf │ └── variable.tf │ ├── aws-sg-ref-v2 │ ├── main.tf │ ├── output.tf │ └── variable.tf │ ├── aws-sg-ref │ ├── main.tf │ ├── output.tf │ └── variable.tf │ ├── aws-sg-requirement │ ├── main.tf │ ├── output.tf │ └── variable.tf │ ├── aws-vpc │ ├── main.tf │ ├── output.tf │ └── variables.tf │ ├── eip │ └── eureka-server │ │ ├── main.tf │ │ ├── output.tf │ │ └── variables.tf │ ├── secrets │ ├── eureka-server │ ├── eureka-server.pub │ ├── eureka-service │ └── eureka-service.pub │ └── terraform-label │ ├── main.tf │ ├── outputs.tf │ └── variables.tf └── vpc ├── environment └── dev │ ├── main.tf │ ├── variables.tf │ └── versions.tf └── modules ├── aws-vpc ├── main.tf ├── output.tf └── variables.tf └── terraform-label ├── main.tf ├── outputs.tf └── variables.tf /terraform.v12/AWS_Client_VPN/aws_client_vpn/environment/dev/variables.tf: -------------------------------------------------------------------------------- 1 | #variable "rds-secret" { type = string } 2 | -------------------------------------------------------------------------------- /terraform.v12/AWS_Client_VPN/aws_client_vpn/environment/dev/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_version = "~> 0.12.0" 3 | } 4 | -------------------------------------------------------------------------------- /terraform.v12/AWS_Client_VPN/aws_client_vpn/modules/aws-client-vpn/main.tf: -------------------------------------------------------------------------------- 1 | resource "aws_ec2_client_vpn_endpoint" "client_vpn" { 2 | description = var.description 3 | server_certificate_arn = var.server_certificate_arn 4 | client_cidr_block = var.client_cidr_block 5 | split_tunnel = var.split_tunnel 6 | depends_on = [var.cloudwatch_log_stream_name] 7 | tags = { 8 | 9 | Name = var.Client_Vpn_Name 10 | 11 | } 12 | 13 | authentication_options { 14 | type = var.type 15 | root_certificate_chain_arn = var.root_certificate_chain_arn 16 | active_directory_id = var.active_directory_id 17 | } 18 | 19 | connection_log_options { 20 | enabled = var.enabled 21 | cloudwatch_log_group = var.cloudwatch_log_group_name 22 | cloudwatch_log_stream = var.cloudwatch_log_stream_name 23 | } 24 | } 25 | 26 | -------------------------------------------------------------------------------- /terraform.v12/AWS_Client_VPN/aws_client_vpn/modules/aws-client-vpn/output.tf: -------------------------------------------------------------------------------- 1 | # aws_clinet_vpn_endpoint 2 | 3 | output "aws_clinet_vpn_endpoint" { 4 | value = aws_ec2_client_vpn_endpoint.client_vpn.dns_name 5 | } -------------------------------------------------------------------------------- /terraform.v12/AWS_Client_VPN/aws_client_vpn/modules/aws-client-vpn/variables.tf: -------------------------------------------------------------------------------- 1 | # aws_ec2_client_vpn_endpoint 2 | variable "Client_Vpn_Name" {} 3 | 4 | variable "description" {} 5 | 6 | variable "server_certificate_arn" {} 7 | 8 | variable "client_cidr_block" {} 9 | 10 | variable "split_tunnel" {} 11 | 12 | 13 | # authentication_options 14 | variable "type" {} 15 | 16 | variable "root_certificate_chain_arn" {} 17 | 18 | variable "active_directory_id" {} 19 | 20 | 21 | # connection_log_options 22 | 23 | variable "enabled" {} 24 | 25 | variable "cloudwatch_log_group_name" {} 26 | 27 | variable "cloudwatch_log_stream_name" {} 28 | 29 | -------------------------------------------------------------------------------- /terraform.v12/AWS_Client_VPN/aws_client_vpn/modules/aws_simple_AD/main.tf: -------------------------------------------------------------------------------- 1 | resource "aws_directory_service_directory" "simple_ad" { 2 | name = var.name 3 | password = var.password 4 | size = var.size 5 | 6 | vpc_settings { 7 | vpc_id = var.vpc_id 8 | subnet_ids = var.subnet_ids 9 | } 10 | 11 | tags = { 12 | Name = var.tag 13 | } 14 | } -------------------------------------------------------------------------------- /terraform.v12/AWS_Client_VPN/aws_client_vpn/modules/aws_simple_AD/output.tf: -------------------------------------------------------------------------------- 1 | # aws_simple_ad_id 2 | 3 | output "aws_simple_ad_id" { 4 | value = aws_directory_service_directory.simple_ad.id 5 | } 6 | 7 | -------------------------------------------------------------------------------- /terraform.v12/AWS_Client_VPN/aws_client_vpn/modules/aws_simple_AD/variables.tf: -------------------------------------------------------------------------------- 1 | # aws_directory_service_directory 2 | 3 | variable "name" {} 4 | 5 | variable "password" {} 6 | 7 | variable "size" {} 8 | 9 | # vpc_settings 10 | 11 | variable "vpc_id" {} 12 | 13 | variable "subnet_ids" {} 14 | 15 | variable "tag" {} 16 | 17 | -------------------------------------------------------------------------------- /terraform.v12/AWS_Client_VPN/aws_client_vpn/modules/terraform-label/outputs.tf: -------------------------------------------------------------------------------- 1 | output "id" { 2 | value = local.id 3 | description = "Disambiguated ID" 4 | } 5 | 6 | output "name" { 7 | value = local.name 8 | description = "Normalized name" 9 | } 10 | 11 | output "namespace" { 12 | value = local.namespace 13 | description = "Normalized namespace" 14 | } 15 | 16 | output "stage" { 17 | value = local.stage 18 | description = "Normalized stage" 19 | } 20 | 21 | output "delimiter" { 22 | value = local.delimiter 23 | description = "Delimiter between `namespace`, `stage`, `name` and `attributes`" 24 | } 25 | 26 | output "attributes" { 27 | value = local.attributes 28 | description = "Normalized attributes" 29 | } 30 | 31 | output "tags" { 32 | value = local.tags 33 | description = "Normalized Tag map" 34 | } 35 | -------------------------------------------------------------------------------- /terraform.v12/AWS_Client_VPN/learning/Simple-AD/Simple-AD-1.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quickbooks2018/Terraform-V-12/1232e64251afc07495e9cc03d01bed3cf8d46050/terraform.v12/AWS_Client_VPN/learning/Simple-AD/Simple-AD-1.PNG -------------------------------------------------------------------------------- /terraform.v12/AWS_Client_VPN/learning/Simple-AD/Simple-AD-2.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quickbooks2018/Terraform-V-12/1232e64251afc07495e9cc03d01bed3cf8d46050/terraform.v12/AWS_Client_VPN/learning/Simple-AD/Simple-AD-2.PNG -------------------------------------------------------------------------------- /terraform.v12/AWS_Client_VPN/learning/Simple-AD/Simple-AD-3.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quickbooks2018/Terraform-V-12/1232e64251afc07495e9cc03d01bed3cf8d46050/terraform.v12/AWS_Client_VPN/learning/Simple-AD/Simple-AD-3.PNG -------------------------------------------------------------------------------- /terraform.v12/AWS_Client_VPN/learning/aws-client-vpn-theory/aws-client-vpn-1.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quickbooks2018/Terraform-V-12/1232e64251afc07495e9cc03d01bed3cf8d46050/terraform.v12/AWS_Client_VPN/learning/aws-client-vpn-theory/aws-client-vpn-1.jpeg -------------------------------------------------------------------------------- /terraform.v12/AWS_Client_VPN/learning/aws-client-vpn-theory/aws-client-vpn-2.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quickbooks2018/Terraform-V-12/1232e64251afc07495e9cc03d01bed3cf8d46050/terraform.v12/AWS_Client_VPN/learning/aws-client-vpn-theory/aws-client-vpn-2.jpeg -------------------------------------------------------------------------------- /terraform.v12/AWS_Client_VPN/learning/aws-client-vpn-theory/aws-client-vpn-3.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quickbooks2018/Terraform-V-12/1232e64251afc07495e9cc03d01bed3cf8d46050/terraform.v12/AWS_Client_VPN/learning/aws-client-vpn-theory/aws-client-vpn-3.jpeg -------------------------------------------------------------------------------- /terraform.v12/AWS_Client_VPN/learning/aws-client-vpn-theory/aws-client-vpn-4.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quickbooks2018/Terraform-V-12/1232e64251afc07495e9cc03d01bed3cf8d46050/terraform.v12/AWS_Client_VPN/learning/aws-client-vpn-theory/aws-client-vpn-4.jpeg -------------------------------------------------------------------------------- /terraform.v12/AWS_Hashicorp_Vault/vpc+vault-ec2/aws/environment/dev/step-3/Note-A-TLS-MUST-BE-THE-SAME-CA-FROM-MASTER.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quickbooks2018/Terraform-V-12/1232e64251afc07495e9cc03d01bed3cf8d46050/terraform.v12/AWS_Hashicorp_Vault/vpc+vault-ec2/aws/environment/dev/step-3/Note-A-TLS-MUST-BE-THE-SAME-CA-FROM-MASTER.txt -------------------------------------------------------------------------------- /terraform.v12/AWS_Hashicorp_Vault/vpc+vault-ec2/aws/environment/dev/variables.tf: -------------------------------------------------------------------------------- 1 | #variable "rds-secret" { type = string } 2 | -------------------------------------------------------------------------------- /terraform.v12/AWS_Hashicorp_Vault/vpc+vault-ec2/aws/environment/dev/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_version = "~> 0.12.0" 3 | } 4 | -------------------------------------------------------------------------------- /terraform.v12/AWS_Hashicorp_Vault/vpc+vault-ec2/aws/modules/aws-dynamodb/main.tf: -------------------------------------------------------------------------------- 1 | resource "aws_dynamodb_table" "dynamodb-table" { 2 | name = var.dynamoTable_Name 3 | read_capacity = var.read_capacity 4 | write_capacity = var.write_capacity 5 | hash_key = "Path" 6 | range_key = "Key" 7 | attribute { 8 | name = "Path" 9 | type = "S" 10 | } 11 | attribute { 12 | name = "Key" 13 | type = "S" 14 | } 15 | 16 | tags = { 17 | Name = var.tag_Name 18 | Environment = var.tag_Environment 19 | } 20 | } -------------------------------------------------------------------------------- /terraform.v12/AWS_Hashicorp_Vault/vpc+vault-ec2/aws/modules/aws-dynamodb/variables.tf: -------------------------------------------------------------------------------- 1 | variable "dynamoTable_Name" {} 2 | 3 | variable "read_capacity" {} 4 | 5 | variable "write_capacity" {} 6 | 7 | variable "tag_Name" {} 8 | 9 | variable "tag_Environment" {} -------------------------------------------------------------------------------- /terraform.v12/AWS_Hashicorp_Vault/vpc+vault-ec2/aws/modules/aws-ec2-keypair/main.tf: -------------------------------------------------------------------------------- 1 | #Creating EC2-Key Pair 2 | provider "aws" { 3 | region = var.region 4 | } 5 | 6 | ######### 7 | # Labels 8 | ######## 9 | module "label" { 10 | source = "../terraform-label" 11 | namespace = var.namespace 12 | name = var.name 13 | stage = var.stage 14 | delimiter = var.delimiter 15 | attributes = var.attributes 16 | tags = var.tags 17 | enabled = var.enabled 18 | } 19 | 20 | resource "aws_key_pair" "keypair" { 21 | key_name = var.key-name 22 | public_key = var.public-key 23 | } 24 | -------------------------------------------------------------------------------- /terraform.v12/AWS_Hashicorp_Vault/vpc+vault-ec2/aws/modules/aws-ec2-keypair/output.tf: -------------------------------------------------------------------------------- 1 | #OUTPUT EC2 KEYPAIR 2 | output "key-pair" { 3 | value = aws_key_pair.keypair.id 4 | } 5 | 6 | output "key-name" { 7 | value = aws_key_pair.keypair.key_name 8 | } 9 | 10 | output "public-key" { 11 | value = aws_key_pair.keypair.public_key 12 | } -------------------------------------------------------------------------------- /terraform.v12/AWS_Hashicorp_Vault/vpc+vault-ec2/aws/modules/aws-ec2-keypair/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_version = "~> 0.12.0" 3 | } 4 | -------------------------------------------------------------------------------- /terraform.v12/AWS_Hashicorp_Vault/vpc+vault-ec2/aws/modules/aws-eip/openvpn/main.tf: -------------------------------------------------------------------------------- 1 | resource "aws_eip" "default" { 2 | vpc = var.vpc 3 | instance = var.instance 4 | network_interface = var.network_interface 5 | associate_with_private_ip = var.associate_with_private_ip 6 | public_ipv4_pool = var.public_ipv4_pool 7 | 8 | tags = merge(var.tags, { "Name" = var.name }) 9 | } -------------------------------------------------------------------------------- /terraform.v12/AWS_Hashicorp_Vault/vpc+vault-ec2/aws/modules/aws-eip/openvpn/output.tf: -------------------------------------------------------------------------------- 1 | output "id" { 2 | description = "Contains the EIP allocation ID" 3 | value = aws_eip.default.id 4 | } 5 | 6 | output "public_ip" { 7 | description = "Contains the public IP address" 8 | value = aws_eip.default.public_ip 9 | } 10 | 11 | output "public_dns" { 12 | description = "Public DNS associated with the Elastic IP address" 13 | value = aws_eip.default.public_dns 14 | } 15 | -------------------------------------------------------------------------------- /terraform.v12/AWS_Hashicorp_Vault/vpc+vault-ec2/aws/modules/aws-rds-mysql/output.tf: -------------------------------------------------------------------------------- 1 | #OUTPUT RDS INSTANCE END POINT 2 | 3 | output "rds-end-point" { 4 | value = aws_db_instance.db.endpoint 5 | } 6 | 7 | output "rds-identifier" { 8 | value = aws_db_instance.db.identifier 9 | } 10 | -------------------------------------------------------------------------------- /terraform.v12/AWS_Hashicorp_Vault/vpc+vault-ec2/aws/modules/aws-sg-cidr-v2/maint.tf: -------------------------------------------------------------------------------- 1 | ######### 2 | # Labels 3 | ######## 4 | module "label" { 5 | source = "../terraform-label" 6 | namespace = var.namespace 7 | name = var.name 8 | stage = var.stage 9 | delimiter = var.delimiter 10 | attributes = var.attributes 11 | tags = var.tags 12 | enabled = var.enabled 13 | } 14 | 15 | 16 | resource "aws_security_group" "internal" { 17 | 18 | name = var.security_group_name 19 | vpc_id = var.vpcID 20 | 21 | dynamic "ingress" { 22 | for_each = var.ServicePorts 23 | content { 24 | from_port = ingress.value 25 | to_port = ingress.value 26 | protocol = "tcp" 27 | cidr_blocks = [var.cidr] 28 | } 29 | } 30 | 31 | egress { 32 | from_port = 0 33 | to_port = 0 34 | protocol = "-1" 35 | cidr_blocks = ["0.0.0.0/0"] 36 | } 37 | 38 | tags = module.label.tags 39 | } -------------------------------------------------------------------------------- /terraform.v12/AWS_Hashicorp_Vault/vpc+vault-ec2/aws/modules/aws-sg-cidr-v2/output.tf: -------------------------------------------------------------------------------- 1 | output "aws_security_group_default" { 2 | value = aws_security_group.internal.id 3 | } -------------------------------------------------------------------------------- /terraform.v12/AWS_Hashicorp_Vault/vpc+vault-ec2/aws/modules/aws-sg-cidr/output.tf: -------------------------------------------------------------------------------- 1 | output "aws_security_group_default" { 2 | value = aws_security_group.default.id 3 | } -------------------------------------------------------------------------------- /terraform.v12/AWS_Hashicorp_Vault/vpc+vault-ec2/aws/modules/aws-sg-ref-v2/output.tf: -------------------------------------------------------------------------------- 1 | output "aws_security_group_default" { 2 | value = aws_security_group.default.id 3 | } -------------------------------------------------------------------------------- /terraform.v12/AWS_Hashicorp_Vault/vpc+vault-ec2/aws/modules/aws-sg-ref/output.tf: -------------------------------------------------------------------------------- 1 | output "aws_security_group_default" { 2 | value = aws_security_group.default.id 3 | } -------------------------------------------------------------------------------- /terraform.v12/AWS_Hashicorp_Vault/vpc+vault-ec2/aws/modules/aws-sg-requirement/output.tf: -------------------------------------------------------------------------------- 1 | output "aws_security_group" { 2 | value = aws_security_group.security_group.id 3 | } 4 | -------------------------------------------------------------------------------- /terraform.v12/AWS_Hashicorp_Vault/vpc+vault-ec2/aws/modules/secrets/vault-demo.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCuBCXOpfpCxbFjwbUKssnqr3O8LKtVgxUMjungPGygk85ptKTm5wFLu9Rt/ZSZrw4pnR1B7o9bLOEsYkSrcamI4oI5O+5C8bsFAcrq5rZ+IFpMS1Z2yORyvWqdKLWSfkM/jGcS53P/St/Wv1pM9EdQS3k6bcdrClcKEe+bk1w935UqUPHasm7gatX4z67ulCb0SqRC4J/yv3R6qHlsOAdLXIDIaED39KN8f424AgPGqi/MEi+zXmUAI+l6c1uD07RcaeeNiFneAC1R07AXpX+8XKJWYi+iUw34scsl5/Ed6oG9s2Mdp7UMvC78/vzA6l6R7BPveGHz+yO73L/gZ7631vMDD1Gmf7s+zbYAYuJxehpssSeTWFbD431eq0x02bK8/xXPSyLPo/90P+e6oMNkxhifMqMTaeN2MnEjTaHpzZrL19V2ut5PzUNIi4x21kYQU+oxrpawiESEDh+LuwhoojNlm5RwmjMwObZavrwtXfWEQH+xxTBMn3cWqgutHqM= 2 | -------------------------------------------------------------------------------- /terraform.v12/AWS_Hashicorp_Vault/vpc+vault-ec2/aws/modules/secrets/vault-failover.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCuBCXOpfpCxbFjwbUKssnqr3O8LKtVgxUMjungPGygk85ptKTm5wFLu9Rt/ZSZrw4pnR1B7o9bLOEsYkSrcamI4oI5O+5C8bsFAcrq5rZ+IFpMS1Z2yORyvWqdKLWSfkM/jGcS53P/St/Wv1pM9EdQS3k6bcdrClcKEe+bk1w935UqUPHasm7gatX4z67ulCb0SqRC4J/yv3R6qHlsOAdLXIDIaED39KN8f424AgPGqi/MEi+zXmUAI+l6c1uD07RcaeeNiFneAC1R07AXpX+8XKJWYi+iUw34scsl5/Ed6oG9s2Mdp7UMvC78/vzA6l6R7BPveGHz+yO73L/gZ7631vMDD1Gmf7s+zbYAYuJxehpssSeTWFbD431eq0x02bK8/xXPSyLPo/90P+e6oMNkxhifMqMTaeN2MnEjTaHpzZrL19V2ut5PzUNIi4x21kYQU+oxrpawiESEDh+LuwhoojNlm5RwmjMwObZavrwtXfWEQH+xxTBMn3cWqgutHqM= 2 | -------------------------------------------------------------------------------- /terraform.v12/AWS_Hashicorp_Vault/vpc+vault-ec2/aws/modules/secrets/vault-master.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCuBCXOpfpCxbFjwbUKssnqr3O8LKtVgxUMjungPGygk85ptKTm5wFLu9Rt/ZSZrw4pnR1B7o9bLOEsYkSrcamI4oI5O+5C8bsFAcrq5rZ+IFpMS1Z2yORyvWqdKLWSfkM/jGcS53P/St/Wv1pM9EdQS3k6bcdrClcKEe+bk1w935UqUPHasm7gatX4z67ulCb0SqRC4J/yv3R6qHlsOAdLXIDIaED39KN8f424AgPGqi/MEi+zXmUAI+l6c1uD07RcaeeNiFneAC1R07AXpX+8XKJWYi+iUw34scsl5/Ed6oG9s2Mdp7UMvC78/vzA6l6R7BPveGHz+yO73L/gZ7631vMDD1Gmf7s+zbYAYuJxehpssSeTWFbD431eq0x02bK8/xXPSyLPo/90P+e6oMNkxhifMqMTaeN2MnEjTaHpzZrL19V2ut5PzUNIi4x21kYQU+oxrpawiESEDh+LuwhoojNlm5RwmjMwObZavrwtXfWEQH+xxTBMn3cWqgutHqM= 2 | -------------------------------------------------------------------------------- /terraform.v12/AWS_Hashicorp_Vault/vpc+vault-ec2/aws/modules/terraform-label/outputs.tf: -------------------------------------------------------------------------------- 1 | output "id" { 2 | value = local.id 3 | description = "Disambiguated ID" 4 | } 5 | 6 | output "name" { 7 | value = local.name 8 | description = "Normalized name" 9 | } 10 | 11 | output "namespace" { 12 | value = local.namespace 13 | description = "Normalized namespace" 14 | } 15 | 16 | output "stage" { 17 | value = local.stage 18 | description = "Normalized stage" 19 | } 20 | 21 | output "delimiter" { 22 | value = local.delimiter 23 | description = "Delimiter between `namespace`, `stage`, `name` and `attributes`" 24 | } 25 | 26 | output "attributes" { 27 | value = local.attributes 28 | description = "Normalized attributes" 29 | } 30 | 31 | output "tags" { 32 | value = local.tags 33 | description = "Normalized Tag map" 34 | } 35 | -------------------------------------------------------------------------------- /terraform.v12/CloudFront/environment/dev/main.tf: -------------------------------------------------------------------------------- 1 | provider "aws" { 2 | region = "us-east-1" 3 | } 4 | 5 | 6 | module "cloudfront" { 7 | source = "../../modules/cloudfront" 8 | bucket-name = "saqlain-mushtaq-com" 9 | tag_key_Name = "saqlain-mushtaq-com" 10 | comment = "DevOps Automation By Muhammad Asim" 11 | domain_aliases = "*.saqlainmushtaq.com" 12 | logs_prefix = "logs" 13 | Environment = "dev" 14 | # One of PriceClass_All, PriceClass_200, PriceClass_100 15 | price_class = "PriceClass_All" 16 | # PUT THE ARN OF YOUR AWS CERTIFICATE MUST BE IN VIRGINIA REGION 17 | acm_certificate_arn = "arn:aws:acm:us-east-1:758522618875:certificate/30e28cb8-c7f8-4fec-8b1e-5064b8b1e5c9" 18 | } -------------------------------------------------------------------------------- /terraform.v12/CloudFront/environment/dev/output.tf: -------------------------------------------------------------------------------- 1 | output "bucket-name" { 2 | value = module.cloudfront.bucknet-name 3 | } -------------------------------------------------------------------------------- /terraform.v12/CloudFront/environment/dev/s3-bucket.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Purpose: Cloudfront Static WebSite 3 | # Maintainer: Muhammad Asim 4 | 5 | BUCKET_NAME=`terraform output | grep -i bucket-name | awk '{print $3}'` 6 | 7 | LOGS="logs/" 8 | 9 | APPLICATION_PATH="./webapp" 10 | 11 | 12 | 13 | # Creating a directory inside our bucket 14 | 15 | aws s3 ls | grep -i "$BUCKET_NAME" 16 | echo $? 17 | 18 | if [ "$?" = "0" ] 19 | then 20 | echo "Bucket "$BUCKET_NAME" exists" 21 | else 22 | echo "Bucket Not Found" 23 | exit 24 | fi 25 | 26 | aws s3api put-object --bucket $BUCKET_NAME --key $LOGS 27 | 28 | aws s3 cp "$APPLICATION_PATH" s3://"$BUCKET_NAME" --recursive 29 | 30 | 31 | 32 | # END -------------------------------------------------------------------------------- /terraform.v12/CloudFront/environment/dev/webapp/index.html: -------------------------------------------------------------------------------- 1 | Cloudfront Automation By DevOps Muhammad Asim -------------------------------------------------------------------------------- /terraform.v12/CloudFront/modules/cloudfront/output.tf: -------------------------------------------------------------------------------- 1 | output "bucknet-name" { 2 | value = aws_s3_bucket.s3bucket.bucket 3 | } -------------------------------------------------------------------------------- /terraform.v12/CloudFront/modules/cloudfront/variables.tf: -------------------------------------------------------------------------------- 1 | variable "bucket-name" {} 2 | 3 | variable "tag_key_Name" {} 4 | 5 | variable "comment" {} 6 | 7 | variable "domain_aliases" {} 8 | 9 | variable "Environment" {} 10 | 11 | variable "logs_prefix" {} 12 | 13 | variable "price_class" {} 14 | 15 | variable "acm_certificate_arn" {} -------------------------------------------------------------------------------- /terraform.v12/RDS_wordpress_docker/environment/dev/variables.tf: -------------------------------------------------------------------------------- 1 | #variable "rds-secret" { type = string } 2 | 3 | variable "rds-username" {} 4 | 5 | variable "rds-password" {} 6 | -------------------------------------------------------------------------------- /terraform.v12/RDS_wordpress_docker/environment/dev/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_version = "~> 0.12.0" 3 | } 4 | -------------------------------------------------------------------------------- /terraform.v12/RDS_wordpress_docker/modules/aws-dynamodb/main.tf: -------------------------------------------------------------------------------- 1 | resource "aws_dynamodb_table" "dynamodb-table" { 2 | name = var.dynamoTable_Name 3 | read_capacity = var.read_capacity 4 | write_capacity = var.write_capacity 5 | hash_key = "Path" 6 | range_key = "Key" 7 | attribute { 8 | name = "Path" 9 | type = "S" 10 | } 11 | attribute { 12 | name = "Key" 13 | type = "S" 14 | } 15 | 16 | tags = { 17 | Name = var.tag_Name 18 | Environment = var.tag_Environment 19 | } 20 | } -------------------------------------------------------------------------------- /terraform.v12/RDS_wordpress_docker/modules/aws-dynamodb/variables.tf: -------------------------------------------------------------------------------- 1 | variable "dynamoTable_Name" {} 2 | 3 | variable "read_capacity" {} 4 | 5 | variable "write_capacity" {} 6 | 7 | variable "tag_Name" {} 8 | 9 | variable "tag_Environment" {} -------------------------------------------------------------------------------- /terraform.v12/RDS_wordpress_docker/modules/aws-ec2-keypair/main.tf: -------------------------------------------------------------------------------- 1 | #Creating EC2-Key Pair 2 | provider "aws" { 3 | region = var.region 4 | } 5 | 6 | ######### 7 | # Labels 8 | ######## 9 | module "label" { 10 | source = "../terraform-label" 11 | namespace = var.namespace 12 | name = var.name 13 | stage = var.stage 14 | delimiter = var.delimiter 15 | attributes = var.attributes 16 | tags = var.tags 17 | enabled = var.enabled 18 | } 19 | 20 | resource "aws_key_pair" "keypair" { 21 | key_name = var.key-name 22 | public_key = var.public-key 23 | } 24 | -------------------------------------------------------------------------------- /terraform.v12/RDS_wordpress_docker/modules/aws-ec2-keypair/output.tf: -------------------------------------------------------------------------------- 1 | #OUTPUT EC2 KEYPAIR 2 | output "key-pair" { 3 | value = aws_key_pair.keypair.id 4 | } 5 | 6 | output "key-name" { 7 | value = aws_key_pair.keypair.key_name 8 | } 9 | 10 | output "public-key" { 11 | value = aws_key_pair.keypair.public_key 12 | } -------------------------------------------------------------------------------- /terraform.v12/RDS_wordpress_docker/modules/aws-ec2-keypair/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_version = "~> 0.12.0" 3 | } 4 | -------------------------------------------------------------------------------- /terraform.v12/RDS_wordpress_docker/modules/aws-ec2/user-data/user-data.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Purpose: Vault Dynamic Credentials Usage in actual production 3 | # Maintainer: DevOps Muhammad Asim 4 | 5 | # Docker Installation 6 | 7 | curl -fsSL https://get.docker.com -o get-docker.sh 8 | sh get-docker.sh 2>&1 > /dev/null 9 | rm -rf get-docker.sh 10 | yum install -y docker 2>&1 > /dev/null 11 | systemctl start docker 12 | systemctl enable docker 13 | 14 | # Docker Compose Installation 15 | 16 | curl -L "https://github.com/docker/compose/releases/download/1.25.5/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose 17 | chmod +x /usr/local/bin/docker-compose 18 | ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose 19 | docker-compose --version -------------------------------------------------------------------------------- /terraform.v12/RDS_wordpress_docker/modules/aws-eip/docker/main.tf: -------------------------------------------------------------------------------- 1 | resource "aws_eip" "default" { 2 | vpc = var.vpc 3 | instance = var.instance 4 | network_interface = var.network_interface 5 | associate_with_private_ip = var.associate_with_private_ip 6 | public_ipv4_pool = var.public_ipv4_pool 7 | 8 | tags = merge(var.tags, { "Name" = var.name }) 9 | } -------------------------------------------------------------------------------- /terraform.v12/RDS_wordpress_docker/modules/aws-eip/docker/output.tf: -------------------------------------------------------------------------------- 1 | output "id" { 2 | description = "Contains the EIP allocation ID" 3 | value = aws_eip.default.id 4 | } 5 | 6 | output "public_ip" { 7 | description = "Contains the public IP address" 8 | value = aws_eip.default.public_ip 9 | } 10 | 11 | output "public_dns" { 12 | description = "Public DNS associated with the Elastic IP address" 13 | value = aws_eip.default.public_dns 14 | } 15 | -------------------------------------------------------------------------------- /terraform.v12/RDS_wordpress_docker/modules/aws-kms/main.tf: -------------------------------------------------------------------------------- 1 | resource "aws_kms_key" "kms" { 2 | description = var.description 3 | deletion_window_in_days = var.deletion_window_in_days 4 | } 5 | 6 | resource "aws_kms_alias" "kms_alias" { 7 | name = var.kms_alias 8 | target_key_id = aws_kms_key.kms.id 9 | } -------------------------------------------------------------------------------- /terraform.v12/RDS_wordpress_docker/modules/aws-kms/variables.tf: -------------------------------------------------------------------------------- 1 | variable "description" {} 2 | 3 | variable "deletion_window_in_days" {} 4 | 5 | variable "kms_alias" {} -------------------------------------------------------------------------------- /terraform.v12/RDS_wordpress_docker/modules/aws-rds-mysql/output.tf: -------------------------------------------------------------------------------- 1 | #OUTPUT RDS INSTANCE END POINT 2 | 3 | output "rds-end-point" { 4 | value = aws_db_instance.db.endpoint 5 | } 6 | 7 | output "rds-identifier" { 8 | value = aws_db_instance.db.identifier 9 | } 10 | -------------------------------------------------------------------------------- /terraform.v12/RDS_wordpress_docker/modules/aws-sg-cidr-v2/maint.tf: -------------------------------------------------------------------------------- 1 | ######### 2 | # Labels 3 | ######## 4 | module "label" { 5 | source = "../terraform-label" 6 | namespace = var.namespace 7 | name = var.name 8 | stage = var.stage 9 | delimiter = var.delimiter 10 | attributes = var.attributes 11 | tags = var.tags 12 | enabled = var.enabled 13 | } 14 | 15 | 16 | resource "aws_security_group" "internal" { 17 | 18 | name = var.security_group_name 19 | vpc_id = var.vpcID 20 | 21 | dynamic "ingress" { 22 | for_each = var.ServicePorts 23 | content { 24 | from_port = ingress.value 25 | to_port = ingress.value 26 | protocol = "tcp" 27 | cidr_blocks = [var.cidr] 28 | } 29 | } 30 | 31 | egress { 32 | from_port = 0 33 | to_port = 0 34 | protocol = "-1" 35 | cidr_blocks = ["0.0.0.0/0"] 36 | } 37 | 38 | tags = module.label.tags 39 | } -------------------------------------------------------------------------------- /terraform.v12/RDS_wordpress_docker/modules/aws-sg-cidr-v2/output.tf: -------------------------------------------------------------------------------- 1 | output "aws_security_group_default" { 2 | value = aws_security_group.internal.id 3 | } -------------------------------------------------------------------------------- /terraform.v12/RDS_wordpress_docker/modules/aws-sg-cidr/output.tf: -------------------------------------------------------------------------------- 1 | output "aws_security_group_default" { 2 | value = aws_security_group.default.id 3 | } -------------------------------------------------------------------------------- /terraform.v12/RDS_wordpress_docker/modules/aws-sg-ref-v2/output.tf: -------------------------------------------------------------------------------- 1 | output "aws_security_group_default" { 2 | value = aws_security_group.default.id 3 | } -------------------------------------------------------------------------------- /terraform.v12/RDS_wordpress_docker/modules/aws-sg-ref/output.tf: -------------------------------------------------------------------------------- 1 | output "aws_security_group_default" { 2 | value = aws_security_group.default.id 3 | } -------------------------------------------------------------------------------- /terraform.v12/RDS_wordpress_docker/modules/aws-sg-requirement/output.tf: -------------------------------------------------------------------------------- 1 | output "aws_security_group" { 2 | value = aws_security_group.security_group.id 3 | } 4 | -------------------------------------------------------------------------------- /terraform.v12/RDS_wordpress_docker/modules/secrets/docker-demo.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCuBCXOpfpCxbFjwbUKssnqr3O8LKtVgxUMjungPGygk85ptKTm5wFLu9Rt/ZSZrw4pnR1B7o9bLOEsYkSrcamI4oI5O+5C8bsFAcrq5rZ+IFpMS1Z2yORyvWqdKLWSfkM/jGcS53P/St/Wv1pM9EdQS3k6bcdrClcKEe+bk1w935UqUPHasm7gatX4z67ulCb0SqRC4J/yv3R6qHlsOAdLXIDIaED39KN8f424AgPGqi/MEi+zXmUAI+l6c1uD07RcaeeNiFneAC1R07AXpX+8XKJWYi+iUw34scsl5/Ed6oG9s2Mdp7UMvC78/vzA6l6R7BPveGHz+yO73L/gZ7631vMDD1Gmf7s+zbYAYuJxehpssSeTWFbD431eq0x02bK8/xXPSyLPo/90P+e6oMNkxhifMqMTaeN2MnEjTaHpzZrL19V2ut5PzUNIi4x21kYQU+oxrpawiESEDh+LuwhoojNlm5RwmjMwObZavrwtXfWEQH+xxTBMn3cWqgutHqM= 2 | -------------------------------------------------------------------------------- /terraform.v12/RDS_wordpress_docker/modules/secrets/vault-demo.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCuBCXOpfpCxbFjwbUKssnqr3O8LKtVgxUMjungPGygk85ptKTm5wFLu9Rt/ZSZrw4pnR1B7o9bLOEsYkSrcamI4oI5O+5C8bsFAcrq5rZ+IFpMS1Z2yORyvWqdKLWSfkM/jGcS53P/St/Wv1pM9EdQS3k6bcdrClcKEe+bk1w935UqUPHasm7gatX4z67ulCb0SqRC4J/yv3R6qHlsOAdLXIDIaED39KN8f424AgPGqi/MEi+zXmUAI+l6c1uD07RcaeeNiFneAC1R07AXpX+8XKJWYi+iUw34scsl5/Ed6oG9s2Mdp7UMvC78/vzA6l6R7BPveGHz+yO73L/gZ7631vMDD1Gmf7s+zbYAYuJxehpssSeTWFbD431eq0x02bK8/xXPSyLPo/90P+e6oMNkxhifMqMTaeN2MnEjTaHpzZrL19V2ut5PzUNIi4x21kYQU+oxrpawiESEDh+LuwhoojNlm5RwmjMwObZavrwtXfWEQH+xxTBMn3cWqgutHqM= 2 | -------------------------------------------------------------------------------- /terraform.v12/RDS_wordpress_docker/modules/secrets/vault-failover.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCuBCXOpfpCxbFjwbUKssnqr3O8LKtVgxUMjungPGygk85ptKTm5wFLu9Rt/ZSZrw4pnR1B7o9bLOEsYkSrcamI4oI5O+5C8bsFAcrq5rZ+IFpMS1Z2yORyvWqdKLWSfkM/jGcS53P/St/Wv1pM9EdQS3k6bcdrClcKEe+bk1w935UqUPHasm7gatX4z67ulCb0SqRC4J/yv3R6qHlsOAdLXIDIaED39KN8f424AgPGqi/MEi+zXmUAI+l6c1uD07RcaeeNiFneAC1R07AXpX+8XKJWYi+iUw34scsl5/Ed6oG9s2Mdp7UMvC78/vzA6l6R7BPveGHz+yO73L/gZ7631vMDD1Gmf7s+zbYAYuJxehpssSeTWFbD431eq0x02bK8/xXPSyLPo/90P+e6oMNkxhifMqMTaeN2MnEjTaHpzZrL19V2ut5PzUNIi4x21kYQU+oxrpawiESEDh+LuwhoojNlm5RwmjMwObZavrwtXfWEQH+xxTBMn3cWqgutHqM= 2 | -------------------------------------------------------------------------------- /terraform.v12/RDS_wordpress_docker/modules/secrets/vault-master.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCuBCXOpfpCxbFjwbUKssnqr3O8LKtVgxUMjungPGygk85ptKTm5wFLu9Rt/ZSZrw4pnR1B7o9bLOEsYkSrcamI4oI5O+5C8bsFAcrq5rZ+IFpMS1Z2yORyvWqdKLWSfkM/jGcS53P/St/Wv1pM9EdQS3k6bcdrClcKEe+bk1w935UqUPHasm7gatX4z67ulCb0SqRC4J/yv3R6qHlsOAdLXIDIaED39KN8f424AgPGqi/MEi+zXmUAI+l6c1uD07RcaeeNiFneAC1R07AXpX+8XKJWYi+iUw34scsl5/Ed6oG9s2Mdp7UMvC78/vzA6l6R7BPveGHz+yO73L/gZ7631vMDD1Gmf7s+zbYAYuJxehpssSeTWFbD431eq0x02bK8/xXPSyLPo/90P+e6oMNkxhifMqMTaeN2MnEjTaHpzZrL19V2ut5PzUNIi4x21kYQU+oxrpawiESEDh+LuwhoojNlm5RwmjMwObZavrwtXfWEQH+xxTBMn3cWqgutHqM= 2 | -------------------------------------------------------------------------------- /terraform.v12/RDS_wordpress_docker/modules/terraform-label/main.tf: -------------------------------------------------------------------------------- 1 | locals { 2 | original_tags = join(var.delimiter, compact(concat(list(var.namespace, var.stage, var.name), var.attributes))) 3 | transformed_tags = var.convert_case ? lower(local.original_tags) : local.original_tags 4 | } 5 | 6 | locals { 7 | id = var.enabled ? local.transformed_tags : "" 8 | 9 | name = var.enabled ? (var.convert_case ? lower(format("%v", var.name)) : format("%v", var.name)) : "" 10 | namespace = var.enabled ? (var.convert_case ? lower(format("%v", var.namespace)) : format("%v", var.namespace)) : "" 11 | stage = var.enabled ? (var.convert_case ? lower(format("%v", var.stage)) : format("%v", var.stage)) : "" 12 | delimiter = var.enabled ? (var.convert_case ? lower(format("%v", var.delimiter)) : format("%v", var.delimiter)) : "" 13 | attributes = var.enabled ? (var.convert_case ? lower(format("%v", join(var.delimiter, compact(var.attributes)))) : format("%v", join(var.delimiter, compact(var.attributes)))) : "" 14 | 15 | tags = merge( 16 | { 17 | "Name" = local.id 18 | "Namespace" = local.namespace 19 | "Stage" = local.stage 20 | }, 21 | var.tags 22 | ) 23 | } 24 | -------------------------------------------------------------------------------- /terraform.v12/RDS_wordpress_docker/modules/terraform-label/outputs.tf: -------------------------------------------------------------------------------- 1 | output "id" { 2 | value = local.id 3 | description = "Disambiguated ID" 4 | } 5 | 6 | output "name" { 7 | value = local.name 8 | description = "Normalized name" 9 | } 10 | 11 | output "namespace" { 12 | value = local.namespace 13 | description = "Normalized namespace" 14 | } 15 | 16 | output "stage" { 17 | value = local.stage 18 | description = "Normalized stage" 19 | } 20 | 21 | output "delimiter" { 22 | value = local.delimiter 23 | description = "Delimiter between `namespace`, `stage`, `name` and `attributes`" 24 | } 25 | 26 | output "attributes" { 27 | value = local.attributes 28 | description = "Normalized attributes" 29 | } 30 | 31 | output "tags" { 32 | value = local.tags 33 | description = "Normalized Tag map" 34 | } 35 | -------------------------------------------------------------------------------- /terraform.v12/aws-rds/environment/dev/variables.tf: -------------------------------------------------------------------------------- 1 | variable "rds-secret" { type = string } 2 | 3 | variable "secret-manager" { type = string } 4 | -------------------------------------------------------------------------------- /terraform.v12/aws-rds/environment/dev/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_version = "~> 0.12.0" 3 | } 4 | -------------------------------------------------------------------------------- /terraform.v12/aws-rds/modules/aws-cgw/main.tf: -------------------------------------------------------------------------------- 1 | ######### 2 | # Labels 3 | ######## 4 | module "label" { 5 | source = "../terraform-label" 6 | namespace = var.namespace 7 | name = var.name 8 | stage = var.stage 9 | delimiter = var.delimiter 10 | attributes = var.attributes 11 | tags = var.tags 12 | enabled = var.enabled 13 | } 14 | 15 | 16 | resource "aws_customer_gateway" "customer-gateway" { 17 | bgp_asn = 65000 18 | ip_address = var.customer-gateway-static-public-ip 19 | type = "ipsec.1" 20 | tags = module.label.tags 21 | } 22 | -------------------------------------------------------------------------------- /terraform.v12/aws-rds/modules/aws-cgw/output.tf: -------------------------------------------------------------------------------- 1 | ###VPN OUTPUTS### 2 | output "customer-gateway" { 3 | value = aws_customer_gateway.customer-gateway.id 4 | } 5 | -------------------------------------------------------------------------------- /terraform.v12/aws-rds/modules/aws-ec2-keypair/main.tf: -------------------------------------------------------------------------------- 1 | #Creating EC2-Key Pair 2 | provider "aws" { 3 | region = var.region 4 | } 5 | 6 | ######### 7 | # Labels 8 | ######## 9 | module "label" { 10 | source = "../terraform-label" 11 | namespace = var.namespace 12 | name = var.name 13 | stage = var.stage 14 | delimiter = var.delimiter 15 | attributes = var.attributes 16 | tags = var.tags 17 | enabled = var.enabled 18 | } 19 | 20 | resource "aws_key_pair" "keypair" { 21 | key_name = var.key-name 22 | public_key = var.public-key 23 | } 24 | -------------------------------------------------------------------------------- /terraform.v12/aws-rds/modules/aws-ec2-keypair/output.tf: -------------------------------------------------------------------------------- 1 | #OUTPUT EC2 KEYPAIR 2 | output "key-pair" { 3 | value = aws_key_pair.keypair.id 4 | } 5 | 6 | output "key-name" { 7 | value = aws_key_pair.keypair.key_name 8 | } 9 | 10 | output "public-key" { 11 | value = aws_key_pair.keypair.public_key 12 | } -------------------------------------------------------------------------------- /terraform.v12/aws-rds/modules/aws-ec2-keypair/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_version = "~> 0.12.0" 3 | } 4 | -------------------------------------------------------------------------------- /terraform.v12/aws-rds/modules/aws-ec2/user-data/user-data.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #OS: Amazon-Linux 3 | #Purpose:Automated deployment of Pritunl 4 | #Owner:cloudgeeks.ca.com 5 | 6 | rpm -iUvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm 7 | 8 | yum update -y 9 | 10 | yum -y install docker-io 11 | 12 | service docker start 13 | 14 | chkconfig docker on 15 | 16 | 17 | docker volume create pritunl-conf 18 | docker volume ls 19 | 20 | docker run --name pritunl --privileged -v ~/pritunl/mondodb:/var/lib/mongodb -v ~/pritunl/pritunl:/var/lib/pritunl -v pritunl-conf:/etc -p 12323:1194/udp -p 12323:1194/tcp -p 80:80/tcp -p 443:443/tcp --restart unless-stopped -d jippi/pritunl 21 | 22 | 23 | 24 | # Username & Password ---> Start 25 | # Username: pritunl Password: pritunl 26 | 27 | 28 | #END -------------------------------------------------------------------------------- /terraform.v12/aws-rds/modules/aws-iam-role/main.tf: -------------------------------------------------------------------------------- 1 | #IAM ROLE CREATION 2 | 3 | ######### 4 | # Labels 5 | ######## 6 | module "label" { 7 | source = "../terraform-label" 8 | namespace = var.namespace 9 | name = var.name 10 | stage = var.stage 11 | delimiter = var.delimiter 12 | attributes = var.attributes 13 | tags = var.tags 14 | enabled = var.enabled 15 | } 16 | 17 | 18 | 19 | resource "aws_iam_role" "this" { 20 | 21 | name = var.iam-role-name 22 | tags = module.label.tags 23 | assume_role_policy = < Start 25 | # Username: pritunl Password: pritunl 26 | 27 | 28 | #END -------------------------------------------------------------------------------- /terraform.v12/aws/modules/aws-iam-role/main.tf: -------------------------------------------------------------------------------- 1 | #IAM ROLE CREATION 2 | 3 | ######### 4 | # Labels 5 | ######## 6 | module "label" { 7 | source = "../terraform-label" 8 | namespace = var.namespace 9 | name = var.name 10 | stage = var.stage 11 | delimiter = var.delimiter 12 | attributes = var.attributes 13 | tags = var.tags 14 | enabled = var.enabled 15 | } 16 | 17 | 18 | 19 | resource "aws_iam_role" "this" { 20 | 21 | name = var.iam-role-name 22 | tags = module.label.tags 23 | assume_role_policy = < 4 | 5 | # Docker Installation 6 | 7 | curl -fsSL https://get.docker.com -o get-docker.sh 8 | sh get-docker.sh 2>&1 > /dev/null 9 | rm -rf get-docker.sh 10 | yum install -y docker 2>&1 > /dev/null 11 | systemctl start docker 12 | systemctl enable docker 13 | 14 | # Docker Compose Installation 15 | 16 | curl -L "https://github.com/docker/compose/releases/download/1.25.5/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose 17 | chmod +x /usr/local/bin/docker-compose 18 | ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose 19 | docker-compose --version -------------------------------------------------------------------------------- /terraform.v12/ecs-rds/modules/aws-eip/docker/main.tf: -------------------------------------------------------------------------------- 1 | resource "aws_eip" "default" { 2 | vpc = var.vpc 3 | instance = var.instance 4 | network_interface = var.network_interface 5 | associate_with_private_ip = var.associate_with_private_ip 6 | public_ipv4_pool = var.public_ipv4_pool 7 | 8 | tags = merge(var.tags, { "Name" = var.name }) 9 | } -------------------------------------------------------------------------------- /terraform.v12/ecs-rds/modules/aws-eip/docker/output.tf: -------------------------------------------------------------------------------- 1 | output "id" { 2 | description = "Contains the EIP allocation ID" 3 | value = aws_eip.default.id 4 | } 5 | 6 | output "public_ip" { 7 | description = "Contains the public IP address" 8 | value = aws_eip.default.public_ip 9 | } 10 | 11 | output "public_dns" { 12 | description = "Public DNS associated with the Elastic IP address" 13 | value = aws_eip.default.public_dns 14 | } 15 | -------------------------------------------------------------------------------- /terraform.v12/ecs-rds/modules/aws-kms/main.tf: -------------------------------------------------------------------------------- 1 | resource "aws_kms_key" "kms" { 2 | description = var.description 3 | deletion_window_in_days = var.deletion_window_in_days 4 | } 5 | 6 | resource "aws_kms_alias" "kms_alias" { 7 | name = var.kms_alias 8 | target_key_id = aws_kms_key.kms.id 9 | } -------------------------------------------------------------------------------- /terraform.v12/ecs-rds/modules/aws-kms/variables.tf: -------------------------------------------------------------------------------- 1 | variable "description" {} 2 | 3 | variable "deletion_window_in_days" {} 4 | 5 | variable "kms_alias" {} -------------------------------------------------------------------------------- /terraform.v12/ecs-rds/modules/aws-rds-mysql/output.tf: -------------------------------------------------------------------------------- 1 | #OUTPUT RDS INSTANCE END POINT 2 | 3 | output "rds-end-point" { 4 | value = aws_db_instance.db.endpoint 5 | } 6 | 7 | output "rds-identifier" { 8 | value = aws_db_instance.db.identifier 9 | } 10 | -------------------------------------------------------------------------------- /terraform.v12/ecs-rds/modules/aws-sg-cidr-v2/maint.tf: -------------------------------------------------------------------------------- 1 | ######### 2 | # Labels 3 | ######## 4 | module "label" { 5 | source = "../terraform-label" 6 | namespace = var.namespace 7 | name = var.name 8 | stage = var.stage 9 | delimiter = var.delimiter 10 | attributes = var.attributes 11 | tags = var.tags 12 | enabled = var.enabled 13 | } 14 | 15 | 16 | resource "aws_security_group" "internal" { 17 | 18 | name = var.security_group_name 19 | vpc_id = var.vpcID 20 | 21 | dynamic "ingress" { 22 | for_each = var.ServicePorts 23 | content { 24 | from_port = ingress.value 25 | to_port = ingress.value 26 | protocol = "tcp" 27 | cidr_blocks = [var.cidr] 28 | } 29 | } 30 | 31 | egress { 32 | from_port = 0 33 | to_port = 0 34 | protocol = "-1" 35 | cidr_blocks = ["0.0.0.0/0"] 36 | } 37 | 38 | tags = module.label.tags 39 | } -------------------------------------------------------------------------------- /terraform.v12/ecs-rds/modules/aws-sg-cidr-v2/output.tf: -------------------------------------------------------------------------------- 1 | output "aws_security_group_default" { 2 | value = aws_security_group.internal.id 3 | } -------------------------------------------------------------------------------- /terraform.v12/ecs-rds/modules/aws-sg-cidr/output.tf: -------------------------------------------------------------------------------- 1 | output "aws_security_group_default" { 2 | value = aws_security_group.default.id 3 | } -------------------------------------------------------------------------------- /terraform.v12/ecs-rds/modules/aws-sg-ref-v2/output.tf: -------------------------------------------------------------------------------- 1 | output "aws_security_group_default" { 2 | value = aws_security_group.default.id 3 | } -------------------------------------------------------------------------------- /terraform.v12/ecs-rds/modules/aws-sg-ref/output.tf: -------------------------------------------------------------------------------- 1 | output "aws_security_group_default" { 2 | value = aws_security_group.default.id 3 | } -------------------------------------------------------------------------------- /terraform.v12/ecs-rds/modules/aws-sg-requirement/output.tf: -------------------------------------------------------------------------------- 1 | output "aws_security_group" { 2 | value = aws_security_group.security_group.id 3 | } 4 | -------------------------------------------------------------------------------- /terraform.v12/ecs-rds/modules/secrets/ecs.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDDhhRF+GNSSn8yTdSgNToIE6gJUoKSbrSWrY8M42AZw92CUOQFnRuSiGY4Q80FDHXJrmC0+l7VT7CPv7a6M/DMtBboomQHbpfmMhEnj7klR10KfjtB2jyQf4MXKqEAzApL6MH+c1aZ+8WvLBwTSPq6/jOss862+zfn+EllCpo7HY9Npgt+tEwe6v4trxq358A8Ibpxn2NRNh0n6t04fRi4im7OLS+bMIHPzHOZBzIccu5JOv9yEvyUH2xwP3rAWcKsSWsqSqIvxywWpM6FeEMI/T56PTS7wTeKlnSjJO0Rlzr9AnZM3/nQA3Zpnfw4oAxqYIUP0UDDRShpaJ1GjfOu4FeI+EqjCV9Jl9ZBH+OSeP6/T3gw96W6rm9QXLwCDz0rHSBo/nVq/JGkfYhuBKtTko59LnfKB9P7GnBfhzsMk7UkuG6EJ+Rcvl84kIl8BYNB7sFUbRXAi7PB+kc1eUgNAP+EbDPmsJTgJlbaSR+tVMvO06TB+bq3L8BH2nFtCOM= Muhammad Asim@DESKTOP-96TI63M 2 | -------------------------------------------------------------------------------- /terraform.v12/ecs-rds/modules/terraform-label/main.tf: -------------------------------------------------------------------------------- 1 | locals { 2 | original_tags = join(var.delimiter, compact(concat(list(var.namespace, var.stage, var.name), var.attributes))) 3 | transformed_tags = var.convert_case ? lower(local.original_tags) : local.original_tags 4 | } 5 | 6 | locals { 7 | id = var.enabled ? local.transformed_tags : "" 8 | 9 | name = var.enabled ? (var.convert_case ? lower(format("%v", var.name)) : format("%v", var.name)) : "" 10 | namespace = var.enabled ? (var.convert_case ? lower(format("%v", var.namespace)) : format("%v", var.namespace)) : "" 11 | stage = var.enabled ? (var.convert_case ? lower(format("%v", var.stage)) : format("%v", var.stage)) : "" 12 | delimiter = var.enabled ? (var.convert_case ? lower(format("%v", var.delimiter)) : format("%v", var.delimiter)) : "" 13 | attributes = var.enabled ? (var.convert_case ? lower(format("%v", join(var.delimiter, compact(var.attributes)))) : format("%v", join(var.delimiter, compact(var.attributes)))) : "" 14 | 15 | tags = merge( 16 | { 17 | "Name" = local.id 18 | "Namespace" = local.namespace 19 | "Stage" = local.stage 20 | }, 21 | var.tags 22 | ) 23 | } 24 | -------------------------------------------------------------------------------- /terraform.v12/ecs-rds/modules/terraform-label/outputs.tf: -------------------------------------------------------------------------------- 1 | output "id" { 2 | value = local.id 3 | description = "Disambiguated ID" 4 | } 5 | 6 | output "name" { 7 | value = local.name 8 | description = "Normalized name" 9 | } 10 | 11 | output "namespace" { 12 | value = local.namespace 13 | description = "Normalized namespace" 14 | } 15 | 16 | output "stage" { 17 | value = local.stage 18 | description = "Normalized stage" 19 | } 20 | 21 | output "delimiter" { 22 | value = local.delimiter 23 | description = "Delimiter between `namespace`, `stage`, `name` and `attributes`" 24 | } 25 | 26 | output "attributes" { 27 | value = local.attributes 28 | description = "Normalized attributes" 29 | } 30 | 31 | output "tags" { 32 | value = local.tags 33 | description = "Normalized Tag map" 34 | } 35 | -------------------------------------------------------------------------------- /terraform.v12/eks/environment/dev/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_version = "~> 0.12.0" 3 | 4 | required_providers { 5 | aws = "~> 2.0" 6 | template = "~> 2.0" 7 | null = "~> 2.0" 8 | local = "~> 1.3" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /terraform.v12/eks/environment/prod/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_version = "~> 0.12.0" 3 | 4 | required_providers { 5 | aws = "~> 2.0" 6 | template = "~> 2.0" 7 | null = "~> 2.0" 8 | local = "~> 1.3" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /terraform.v12/eks/modules/eks-autoscale-group/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_version = "~> 0.12.0" 3 | 4 | required_providers { 5 | aws = "~> 2.0" 6 | template = "~> 2.0" 7 | null = "~> 2.0" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /terraform.v12/eks/modules/eks-cluster-master/configmap-auth.yaml.tpl: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: aws-auth 5 | namespace: kube-system 6 | data: 7 | mapRoles: | 8 | ${indent(4, map_worker_roles_yaml)} 9 | %{if map_additional_iam_roles_yaml != "[]" } 10 | ${indent(4, map_additional_iam_roles_yaml)} 11 | %{ endif } 12 | %{if map_additional_iam_users_yaml != "[]" } 13 | mapUsers: | 14 | ${indent(4, map_additional_iam_users_yaml)} 15 | %{ endif } 16 | %{if map_additional_aws_accounts_yaml != "[]" } 17 | mapAccounts: | 18 | ${indent(4, map_additional_aws_accounts_yaml)} 19 | %{ endif } 20 | -------------------------------------------------------------------------------- /terraform.v12/eks/modules/eks-cluster-master/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_version = "~> 0.12.0" 3 | 4 | required_providers { 5 | aws = "~> 2.0" 6 | template = "~> 2.0" 7 | null = "~> 2.0" 8 | local = "~> 1.3" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /terraform.v12/eks/modules/eks-cluster-workers/userdata.tpl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # userdata for EKS worker nodes to properly configure Kubernetes applications on EC2 instances 4 | # https://docs.aws.amazon.com/eks/latest/userguide/launch-workers.html 5 | # https://aws.amazon.com/blogs/opensource/improvements-eks-worker-node-provisioning/ 6 | # https://github.com/awslabs/amazon-eks-ami/blob/master/files/bootstrap.sh#L97 7 | 8 | ${before_cluster_joining_userdata} 9 | 10 | export KUBELET_EXTRA_ARGS=${bootstrap_extra_args} 11 | 12 | /etc/eks/bootstrap.sh --apiserver-endpoint '${cluster_endpoint}' --b64-cluster-ca '${certificate_authority_data}' '${cluster_name}' 13 | 14 | ${after_cluster_joining_userdata} 15 | -------------------------------------------------------------------------------- /terraform.v12/eks/modules/eks-cluster-workers/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_version = "~> 0.12.0" 3 | 4 | required_providers { 5 | aws = "~> 2.0" 6 | template = "~> 2.0" 7 | local = "~> 1.3" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /terraform.v12/eks/modules/labels/main.tf: -------------------------------------------------------------------------------- 1 | locals { 2 | original_tags = join(var.delimiter, compact(concat(list(var.namespace, var.stage, var.name), var.attributes))) 3 | transformed_tags = var.convert_case ? lower(local.original_tags) : local.original_tags 4 | } 5 | 6 | locals { 7 | id = var.enabled ? local.transformed_tags : "" 8 | 9 | name = var.enabled ? (var.convert_case ? lower(format("%v", var.name)) : format("%v", var.name)) : "" 10 | namespace = var.enabled ? (var.convert_case ? lower(format("%v", var.namespace)) : format("%v", var.namespace)) : "" 11 | stage = var.enabled ? (var.convert_case ? lower(format("%v", var.stage)) : format("%v", var.stage)) : "" 12 | delimiter = var.enabled ? (var.convert_case ? lower(format("%v", var.delimiter)) : format("%v", var.delimiter)) : "" 13 | attributes = var.enabled ? (var.convert_case ? lower(format("%v", join(var.delimiter, compact(var.attributes)))) : format("%v", join(var.delimiter, compact(var.attributes)))) : "" 14 | 15 | tags = merge( 16 | { 17 | "Name" = local.id 18 | "Namespace" = local.namespace 19 | "Stage" = local.stage 20 | }, 21 | var.tags 22 | ) 23 | } 24 | -------------------------------------------------------------------------------- /terraform.v12/eks/modules/labels/outputs.tf: -------------------------------------------------------------------------------- 1 | output "id" { 2 | value = local.id 3 | description = "Disambiguated ID" 4 | } 5 | 6 | output "name" { 7 | value = local.name 8 | description = "Normalized name" 9 | } 10 | 11 | output "namespace" { 12 | value = local.namespace 13 | description = "Normalized namespace" 14 | } 15 | 16 | output "stage" { 17 | value = local.stage 18 | description = "Normalized stage" 19 | } 20 | 21 | output "delimiter" { 22 | value = local.delimiter 23 | description = "Delimiter between `namespace`, `stage`, `name` and `attributes`" 24 | } 25 | 26 | output "attributes" { 27 | value = local.attributes 28 | description = "Normalized attributes" 29 | } 30 | 31 | output "tags" { 32 | value = local.tags 33 | description = "Normalized Tag map" 34 | } 35 | -------------------------------------------------------------------------------- /terraform.v12/emr/modules/emr/outputs.tf: -------------------------------------------------------------------------------- 1 | output "id" { 2 | value = aws_emr_cluster.cluster.id 3 | } 4 | 5 | output "name" { 6 | value = aws_emr_cluster.cluster.name 7 | } 8 | 9 | output "master_public_dns" { 10 | value = aws_emr_cluster.cluster.master_public_dns 11 | } 12 | -------------------------------------------------------------------------------- /terraform.v12/emr/modules/emr/variables.tf: -------------------------------------------------------------------------------- 1 | variable "name" {} 2 | variable "subnet_id" {} 3 | variable "key_name" {} 4 | variable "release_label" {} 5 | variable "applications" { 6 | type = "list" 7 | } 8 | variable "master_instance_type" {} 9 | variable "master_ebs_size" {} 10 | variable "core_instance_type" {} 11 | variable "core_instance_count" {} 12 | variable "core_ebs_size" {} 13 | variable "emr_master_security_group" {} 14 | variable "emr_slave_security_group" {} 15 | variable "emr_ec2_instance_profile" {} 16 | variable "emr_service_role" {} 17 | variable "emr_autoscaling_role" {} 18 | -------------------------------------------------------------------------------- /terraform.v12/emr/modules/iam/outputs.tf: -------------------------------------------------------------------------------- 1 | output "emr_service_role" { 2 | value = aws_iam_role.emr_service_role.arn 3 | } 4 | 5 | output "emr_autoscaling_role" { 6 | value = aws_iam_role.emr_autoscaling_role.arn 7 | } 8 | 9 | output "emr_ec2_instance_profile" { 10 | value = aws_iam_instance_profile.emr_ec2_instance_profile.arn 11 | } 12 | -------------------------------------------------------------------------------- /terraform.v12/emr/modules/security/outputs.tf: -------------------------------------------------------------------------------- 1 | output "emr_master_security_group" { 2 | value = aws_security_group.emr_master.id 3 | } 4 | 5 | output "emr_slave_security_group" { 6 | value = aws_security_group.emr_slave.id 7 | } 8 | -------------------------------------------------------------------------------- /terraform.v12/emr/modules/security/variables.tf: -------------------------------------------------------------------------------- 1 | variable "name" {} 2 | variable "vpc_id" {} 3 | variable "ingress_cidr_blocks" {} 4 | -------------------------------------------------------------------------------- /terraform.v12/emr/outputs.tf: -------------------------------------------------------------------------------- 1 | output "id" { 2 | value = module.emr.id 3 | } 4 | 5 | output "name" { 6 | value = module.emr.name 7 | } 8 | 9 | output "master_public_dns" { 10 | value = module.emr.master_public_dns 11 | } 12 | -------------------------------------------------------------------------------- /terraform.v12/emr/terraform emr.rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quickbooks2018/Terraform-V-12/1232e64251afc07495e9cc03d01bed3cf8d46050/terraform.v12/emr/terraform emr.rar -------------------------------------------------------------------------------- /terraform.v12/emr/terraform.tfvars: -------------------------------------------------------------------------------- 1 | # EMR general configurations 2 | name = "spark-app" 3 | region = "us-west-2" 4 | subnet_id = "subnet-02b2731c07384f6d2" 5 | vpc_id = "vpc-04a7f889ef6d67036" 6 | key_name = "vault" 7 | ingress_cidr_blocks = "0.0.0.0/0" 8 | release_label = "emr-5.16.0" 9 | applications = ["Spark"] 10 | 11 | # Master node configurations 12 | master_instance_type = "m3.xlarge" 13 | master_ebs_size = "50" 14 | 15 | # Slave nodes configurations 16 | core_instance_type = "m3.xlarge" 17 | core_instance_count = 1 18 | core_ebs_size = "50" 19 | -------------------------------------------------------------------------------- /terraform.v12/emr/variables.tf: -------------------------------------------------------------------------------- 1 | variable "name" {} 2 | variable "region" {} 3 | variable "subnet_id" {} 4 | variable "vpc_id" {} 5 | variable "key_name" {} 6 | variable "release_label" {} 7 | variable "applications" { 8 | type = "list" 9 | } 10 | variable "master_instance_type" {} 11 | variable "master_ebs_size" {} 12 | variable "core_instance_type" {} 13 | variable "core_instance_count" {} 14 | variable "core_ebs_size" {} 15 | variable "ingress_cidr_blocks" {} 16 | -------------------------------------------------------------------------------- /terraform.v12/terraform+eksctl+ingress/environment/dev/main.tf: -------------------------------------------------------------------------------- 1 | provider "aws" { 2 | region = "us-east-1" 3 | } 4 | 5 | 6 | module "vpc" { 7 | source = "../../modules/vpc" 8 | vpc-location = "Virginia" 9 | namespace = "cloudgeeks.ca" 10 | name = "vpc" 11 | stage = "dev" 12 | map_public_ip_on_launch = "false" 13 | total-nat-gateway-required = "1" 14 | create_database_subnet_group = "false" 15 | vpc-cidr = "10.11.0.0/16" 16 | vpc-public-subnet-cidr = ["10.11.16.0/20","10.11.32.0/20"] 17 | vpc-private-subnet-cidr = ["10.11.48.0/20","10.11.64.0/20"] 18 | vpc-database_subnets-cidr = ["10.11.80.0/20", "10.11.96.0/20"] 19 | cluster-name = "cloudgeeks-ca-eks" 20 | 21 | } 22 | -------------------------------------------------------------------------------- /terraform.v12/terraform+eksctl+ingress/environment/dev/output.tf: -------------------------------------------------------------------------------- 1 | output "vpc-id" { 2 | value = module.vpc.vpc-id 3 | } 4 | 5 | output "public-subnet-ids" { 6 | value = module.vpc.public-subnet-ids 7 | } 8 | 9 | output "private-subnets-ids" { 10 | value = module.vpc.private-subnet-ids 11 | } -------------------------------------------------------------------------------- /terraform.v12/terraform+eksctl+ingress/kubewatch-slack-notifications: -------------------------------------------------------------------------------- 1 | # https://github.com/bitnami/charts/tree/master/bitnami/kubewatch 2 | 3 | # Kubewatch setup in 10 sec single command 4 | 5 | helm install kubewatch bitnami/kubewatch \ 6 | --set=slack.channel="devops",slack.token="SIMPLY-PUT-YOUR-TOKEN-HERE-ALL-NOTIFICATIONS-WILL-BE-IN-YOUR-SLACK-CHANNEL-POD-DELETE-CREATE--->https://github.com/bitnami/charts/tree/master/bitnami/kubewatch" 7 | -------------------------------------------------------------------------------- /terraform.v12/terraform+eksctl+ingress/modules/labels/main.tf: -------------------------------------------------------------------------------- 1 | locals { 2 | original_tags = join(var.delimiter, compact(concat(list(var.namespace, var.stage, var.name), var.attributes))) 3 | transformed_tags = var.convert_case ? lower(local.original_tags) : local.original_tags 4 | } 5 | 6 | locals { 7 | id = var.enabled ? local.transformed_tags : "" 8 | 9 | name = var.enabled ? (var.convert_case ? lower(format("%v", var.name)) : format("%v", var.name)) : "" 10 | namespace = var.enabled ? (var.convert_case ? lower(format("%v", var.namespace)) : format("%v", var.namespace)) : "" 11 | stage = var.enabled ? (var.convert_case ? lower(format("%v", var.stage)) : format("%v", var.stage)) : "" 12 | delimiter = var.enabled ? (var.convert_case ? lower(format("%v", var.delimiter)) : format("%v", var.delimiter)) : "" 13 | attributes = var.enabled ? (var.convert_case ? lower(format("%v", join(var.delimiter, compact(var.attributes)))) : format("%v", join(var.delimiter, compact(var.attributes)))) : "" 14 | 15 | tags = merge( 16 | { 17 | "Name" = local.id 18 | "Namespace" = local.namespace 19 | "Stage" = local.stage 20 | }, 21 | var.tags 22 | ) 23 | } 24 | -------------------------------------------------------------------------------- /terraform.v12/terraform+eksctl+ingress/modules/labels/outputs.tf: -------------------------------------------------------------------------------- 1 | output "id" { 2 | value = local.id 3 | description = "Disambiguated ID" 4 | } 5 | 6 | output "name" { 7 | value = local.name 8 | description = "Normalized name" 9 | } 10 | 11 | output "namespace" { 12 | value = local.namespace 13 | description = "Normalized namespace" 14 | } 15 | 16 | output "stage" { 17 | value = local.stage 18 | description = "Normalized stage" 19 | } 20 | 21 | output "delimiter" { 22 | value = local.delimiter 23 | description = "Delimiter between `namespace`, `stage`, `name` and `attributes`" 24 | } 25 | 26 | output "attributes" { 27 | value = local.attributes 28 | description = "Normalized attributes" 29 | } 30 | 31 | output "tags" { 32 | value = local.tags 33 | description = "Normalized Tag map" 34 | } 35 | -------------------------------------------------------------------------------- /terraform.v12/terraform+eksctl+ingress/terraform-vpc+eks+alb-ingress.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quickbooks2018/Terraform-V-12/1232e64251afc07495e9cc03d01bed3cf8d46050/terraform.v12/terraform+eksctl+ingress/terraform-vpc+eks+alb-ingress.zip -------------------------------------------------------------------------------- /terraform.v12/terraform-vpc+eks+alb-ingress/modules/aws-ec2-keypair/main.tf: -------------------------------------------------------------------------------- 1 | #Creating EC2-Key Pair 2 | provider "aws" { 3 | region = var.region 4 | } 5 | 6 | ######### 7 | # Labels 8 | ######## 9 | module "label" { 10 | source = "../labels" 11 | namespace = var.namespace 12 | name = var.name 13 | stage = var.stage 14 | delimiter = var.delimiter 15 | attributes = var.attributes 16 | tags = var.tags 17 | enabled = var.enabled 18 | } 19 | 20 | resource "aws_key_pair" "keypair" { 21 | key_name = var.key-name 22 | public_key = var.public-key 23 | } 24 | -------------------------------------------------------------------------------- /terraform.v12/terraform-vpc+eks+alb-ingress/modules/aws-ec2-keypair/output.tf: -------------------------------------------------------------------------------- 1 | #OUTPUT EC2 KEYPAIR 2 | output "key-pair" { 3 | value = aws_key_pair.keypair.id 4 | } 5 | 6 | output "key-name" { 7 | value = aws_key_pair.keypair.key_name 8 | } 9 | 10 | output "public-key" { 11 | value = aws_key_pair.keypair.public_key 12 | } -------------------------------------------------------------------------------- /terraform.v12/terraform-vpc+eks+alb-ingress/modules/aws-ec2-keypair/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_version = "~> 0.12.0" 3 | } 4 | -------------------------------------------------------------------------------- /terraform.v12/terraform-vpc+eks+alb-ingress/modules/eks-autoscale-group/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_version = "~> 0.12.0" 3 | 4 | required_providers { 5 | aws = "~> 2.0" 6 | template = "~> 2.0" 7 | null = "~> 2.0" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /terraform.v12/terraform-vpc+eks+alb-ingress/modules/eks-cluster-master/configmap-auth.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: aws-auth 5 | namespace: kube-system 6 | data: 7 | mapRoles: | 8 | - "groups": 9 | - "system:bootstrappers" 10 | - "system:nodes" 11 | "rolearn": "arn:aws:iam::823629353122:role/cloudgeeks.ca-dev-eks-workers" 12 | "username": "system:node:{{EC2PrivateDNSName}}" 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /terraform.v12/terraform-vpc+eks+alb-ingress/modules/eks-cluster-master/configmap-auth.yaml.tpl: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: aws-auth 5 | namespace: kube-system 6 | data: 7 | mapRoles: | 8 | ${indent(4, map_worker_roles_yaml)} 9 | %{if map_additional_iam_roles_yaml != "[]" } 10 | ${indent(4, map_additional_iam_roles_yaml)} 11 | %{ endif } 12 | %{if map_additional_iam_users_yaml != "[]" } 13 | mapUsers: | 14 | ${indent(4, map_additional_iam_users_yaml)} 15 | %{ endif } 16 | %{if map_additional_aws_accounts_yaml != "[]" } 17 | mapAccounts: | 18 | ${indent(4, map_additional_aws_accounts_yaml)} 19 | %{ endif } 20 | -------------------------------------------------------------------------------- /terraform.v12/terraform-vpc+eks+alb-ingress/modules/eks-cluster-master/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_version = "~> 0.12.0" 3 | 4 | required_providers { 5 | aws = "~> 2.0" 6 | template = "~> 2.0" 7 | null = "~> 2.0" 8 | local = "~> 1.3" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /terraform.v12/terraform-vpc+eks+alb-ingress/modules/eks-cluster-workers/userdata.tpl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # userdata for EKS worker nodes to properly configure Kubernetes applications on EC2 instances 4 | # https://docs.aws.amazon.com/eks/latest/userguide/launch-workers.html 5 | # https://aws.amazon.com/blogs/opensource/improvements-eks-worker-node-provisioning/ 6 | # https://github.com/awslabs/amazon-eks-ami/blob/master/files/bootstrap.sh#L97 7 | 8 | ${before_cluster_joining_userdata} 9 | 10 | export KUBELET_EXTRA_ARGS=${bootstrap_extra_args} 11 | 12 | /etc/eks/bootstrap.sh --apiserver-endpoint '${cluster_endpoint}' --b64-cluster-ca '${certificate_authority_data}' '${cluster_name}' 13 | 14 | ${after_cluster_joining_userdata} 15 | -------------------------------------------------------------------------------- /terraform.v12/terraform-vpc+eks+alb-ingress/modules/eks-cluster-workers/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_version = "~> 0.12.0" 3 | 4 | required_providers { 5 | aws = "~> 2.0" 6 | template = "~> 2.0" 7 | local = "~> 1.3" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /terraform.v12/terraform-vpc+eks+alb-ingress/modules/labels/outputs.tf: -------------------------------------------------------------------------------- 1 | output "id" { 2 | value = local.id 3 | description = "Disambiguated ID" 4 | } 5 | 6 | output "name" { 7 | value = local.name 8 | description = "Normalized name" 9 | } 10 | 11 | output "namespace" { 12 | value = local.namespace 13 | description = "Normalized namespace" 14 | } 15 | 16 | output "stage" { 17 | value = local.stage 18 | description = "Normalized stage" 19 | } 20 | 21 | output "delimiter" { 22 | value = local.delimiter 23 | description = "Delimiter between `namespace`, `stage`, `name` and `attributes`" 24 | } 25 | 26 | output "attributes" { 27 | value = local.attributes 28 | description = "Normalized attributes" 29 | } 30 | 31 | output "tags" { 32 | value = local.tags 33 | description = "Normalized Tag map" 34 | } 35 | -------------------------------------------------------------------------------- /terraform.v12/terraform-vpc+eks+alb-ingress/modules/secrets/cloudelligent-eks.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCuBCXOpfpCxbFjwbUKssnqr3O8LKtVgxUMjungPGygk85ptKTm5wFLu9Rt/ZSZrw4pnR1B7o9bLOEsYkSrcamI4oI5O+5C8bsFAcrq5rZ+IFpMS1Z2yORyvWqdKLWSfkM/jGcS53P/St/Wv1pM9EdQS3k6bcdrClcKEe+bk1w935UqUPHasm7gatX4z67ulCb0SqRC4J/yv3R6qHlsOAdLXIDIaED39KN8f424AgPGqi/MEi+zXmUAI+l6c1uD07RcaeeNiFneAC1R07AXpX+8XKJWYi+iUw34scsl5/Ed6oG9s2Mdp7UMvC78/vzA6l6R7BPveGHz+yO73L/gZ7631vMDD1Gmf7s+zbYAYuJxehpssSeTWFbD431eq0x02bK8/xXPSyLPo/90P+e6oMNkxhifMqMTaeN2MnEjTaHpzZrL19V2ut5PzUNIi4x21kYQU+oxrpawiESEDh+LuwhoojNlm5RwmjMwObZavrwtXfWEQH+xxTBMn3cWqgutHqM= 2 | -------------------------------------------------------------------------------- /terraform.v12/terraform-vpc+eks+alb-ingress/terraform-vpc+eks+alb-ingress.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quickbooks2018/Terraform-V-12/1232e64251afc07495e9cc03d01bed3cf8d46050/terraform.v12/terraform-vpc+eks+alb-ingress/terraform-vpc+eks+alb-ingress.zip -------------------------------------------------------------------------------- /terraform.v12/vpc+application-load-balancer-ec2-role-ec2-launch-template/environment/dev/ec2-key-pair.tf: -------------------------------------------------------------------------------- 1 | resource "aws_key_pair" "rabbitmq-ec2-key" { 2 | key_name = "rabbitmq" 3 | public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQChSTHHBoMAYz5zkl4ctXoEYQ2fJ9cvEX9kN7qyTugTixN8SayZHDUxOiTyDHdgJyjws6SxvirOjC8G+CcmUUs+MqiZ7skkoR07Qzkyu3cY4AuMu0lCPMAF8F25F5RzxO2S2/nwz+ynBJqrBsZJGkjgvpGT5kxqYuM/uPPbiVuTWWDsTMdjsz0XcEUOrzeJ58l53Q+oU0AV3V4NyFgd2Mpyyaz2EdsU6H6i+c2holwNXOjtx08A2SdYEq8XoWDdCGZZunBbeDoubpQFOr7qi75u8c8E9vRl3rKjMoHjCh0mD8mzIcIZBJJKu63YxWvVXPLZRyWLDzbj7FupnB4Ozbx5 MuhammadAsim@DESKTOP-ENE2K87" 4 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+application-load-balancer-ec2-role-ec2-launch-template/environment/dev/variables.tf: -------------------------------------------------------------------------------- 1 | #variable "rds-secret" { type = string } 2 | -------------------------------------------------------------------------------- /terraform.v12/vpc+application-load-balancer-ec2-role-ec2-launch-template/modules/aws-alb-tg/main.tf: -------------------------------------------------------------------------------- 1 | resource "aws_lb_target_group" "alb-tg" { 2 | name = var.alb-tg-name 3 | port = var.target-group-port 4 | protocol = var.target-group-protocol 5 | vpc_id = var.vpc-id 6 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+application-load-balancer-ec2-role-ec2-launch-template/modules/aws-alb-tg/output.tf: -------------------------------------------------------------------------------- 1 | output "target-group-arn" { 2 | value = aws_lb_target_group.alb-tg.arn 3 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+application-load-balancer-ec2-role-ec2-launch-template/modules/aws-alb-tg/variables.tf: -------------------------------------------------------------------------------- 1 | variable "alb-tg-name" { 2 | default = "" 3 | } 4 | variable "target-group-port" { 5 | default = "" 6 | } 7 | 8 | variable "target-group-protocol" { 9 | default = "" 10 | } 11 | 12 | variable "vpc-id" { 13 | default = "" 14 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+application-load-balancer-ec2-role-ec2-launch-template/modules/aws-alb/output.tf: -------------------------------------------------------------------------------- 1 | #OUTPUT 2 | output "aws-alb" { 3 | value = aws_lb.alb.id 4 | } 5 | 6 | -------------------------------------------------------------------------------- /terraform.v12/vpc+application-load-balancer-ec2-role-ec2-launch-template/modules/aws-alb/variable.tf: -------------------------------------------------------------------------------- 1 | #ALB VARIABLES 2 | 3 | variable "alb-name" { 4 | default = "" 5 | } 6 | 7 | variable "internal" { 8 | default = "" 9 | } 10 | 11 | variable "alb-sg" { 12 | default = "" 13 | } 14 | 15 | variable "alb-subnets" { 16 | type = list(string) 17 | } 18 | 19 | variable "alb-tag" { 20 | default = "" 21 | } 22 | 23 | variable "target-group-arn" { 24 | default = "" 25 | } 26 | 27 | variable "certificate-arn" { 28 | default = "" 29 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+application-load-balancer-ec2-role-ec2-launch-template/modules/aws-asg/aws-ec2-lauch-template/variables.tf: -------------------------------------------------------------------------------- 1 | # Variables 2 | variable "aws-launch-template-name" {} 3 | 4 | variable "aws-launch-template-description" {} 5 | 6 | variable ebs-volume-size { 7 | default = "8" 8 | } 9 | 10 | variable "instance-profile-arn" {} 11 | 12 | variable "ec2-ami-id" {} 13 | 14 | variable "ec2-instance-type" {} 15 | 16 | variable "security-group-ids" {} 17 | 18 | variable "ec2-user-data" {} 19 | 20 | variable "ec2-tag" {} -------------------------------------------------------------------------------- /terraform.v12/vpc+application-load-balancer-ec2-role-ec2-launch-template/modules/aws-ec2-key-pair/create-key-pair.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ssh-keygen -f rabbitmq 4 | ssh-keygen -f rabbitmq -e -m pem 5 | mv rabbitmq rabbitq.pem 6 | 7 | 8 | #END -------------------------------------------------------------------------------- /terraform.v12/vpc+application-load-balancer-ec2-role-ec2-launch-template/modules/aws-ec2-key-pair/main.tf: -------------------------------------------------------------------------------- 1 | resource "aws_key_pair" "rabbitmq-ec2-key" { 2 | key_name = "rabbitmq" 3 | public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQChSTHHBoMAYz5zkl4ctXoEYQ2fJ9cvEX9kN7qyTugTixN8SayZHDUxOiTyDHdgJyjws6SxvirOjC8G+CcmUUs+MqiZ7skkoR07Qzkyu3cY4AuMu0lCPMAF8F25F5RzxO2S2/nwz+ynBJqrBsZJGkjgvpGT5kxqYuM/uPPbiVuTWWDsTMdjsz0XcEUOrzeJ58l53Q+oU0AV3V4NyFgd2Mpyyaz2EdsU6H6i+c2holwNXOjtx08A2SdYEq8XoWDdCGZZunBbeDoubpQFOr7qi75u8c8E9vRl3rKjMoHjCh0mD8mzIcIZBJJKu63YxWvVXPLZRyWLDzbj7FupnB4Ozbx5 MuhammadAsim@DESKTOP-ENE2K87" 4 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+application-load-balancer-ec2-role-ec2-launch-template/modules/aws-ec2-key-pair/rabbitmq.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQChSTHHBoMAYz5zkl4ctXoEYQ2fJ9cvEX9kN7qyTugTixN8SayZHDUxOiTyDHdgJyjws6SxvirOjC8G+CcmUUs+MqiZ7skkoR07Qzkyu3cY4AuMu0lCPMAF8F25F5RzxO2S2/nwz+ynBJqrBsZJGkjgvpGT5kxqYuM/uPPbiVuTWWDsTMdjsz0XcEUOrzeJ58l53Q+oU0AV3V4NyFgd2Mpyyaz2EdsU6H6i+c2holwNXOjtx08A2SdYEq8XoWDdCGZZunBbeDoubpQFOr7qi75u8c8E9vRl3rKjMoHjCh0mD8mzIcIZBJJKu63YxWvVXPLZRyWLDzbj7FupnB4Ozbx5 MuhammadAsim@DESKTOP-ENE2K87 2 | -------------------------------------------------------------------------------- /terraform.v12/vpc+application-load-balancer-ec2-role-ec2-launch-template/modules/aws-sg-cidr-v2/maint.tf: -------------------------------------------------------------------------------- 1 | ######### 2 | # Labels 3 | ######## 4 | module "label" { 5 | source = "../terraform-label" 6 | namespace = var.namespace 7 | name = var.name 8 | stage = var.stage 9 | delimiter = var.delimiter 10 | attributes = var.attributes 11 | tags = var.tags 12 | enabled = var.enabled 13 | } 14 | 15 | 16 | resource "aws_security_group" "internal" { 17 | 18 | name = var.security_group_name 19 | vpc_id = var.vpcID 20 | 21 | dynamic "ingress" { 22 | for_each = var.ServicePorts 23 | content { 24 | from_port = ingress.value 25 | to_port = ingress.value 26 | protocol = "tcp" 27 | cidr_blocks = [var.cidr] 28 | } 29 | } 30 | 31 | egress { 32 | from_port = 0 33 | to_port = 0 34 | protocol = "-1" 35 | cidr_blocks = ["0.0.0.0/0"] 36 | } 37 | 38 | tags = module.label.tags 39 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+application-load-balancer-ec2-role-ec2-launch-template/modules/aws-sg-cidr-v2/output.tf: -------------------------------------------------------------------------------- 1 | output "aws_security_group_default" { 2 | value = aws_security_group.internal.id 3 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+application-load-balancer-ec2-role-ec2-launch-template/modules/aws-sg-cidr/output.tf: -------------------------------------------------------------------------------- 1 | output "aws_security_group_default" { 2 | value = aws_security_group.default.id 3 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+application-load-balancer-ec2-role-ec2-launch-template/modules/aws-sg-ref-v2/output.tf: -------------------------------------------------------------------------------- 1 | output "aws_security_group_default" { 2 | value = aws_security_group.default.id 3 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+application-load-balancer-ec2-role-ec2-launch-template/modules/aws-sg-ref/output.tf: -------------------------------------------------------------------------------- 1 | output "aws_security_group_default" { 2 | value = aws_security_group.default.id 3 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+application-load-balancer-ec2-role-ec2-launch-template/modules/terraform-label/outputs.tf: -------------------------------------------------------------------------------- 1 | output "id" { 2 | value = local.id 3 | description = "Disambiguated ID" 4 | } 5 | 6 | output "name" { 7 | value = local.name 8 | description = "Normalized name" 9 | } 10 | 11 | output "namespace" { 12 | value = local.namespace 13 | description = "Normalized namespace" 14 | } 15 | 16 | output "stage" { 17 | value = local.stage 18 | description = "Normalized stage" 19 | } 20 | 21 | output "delimiter" { 22 | value = local.delimiter 23 | description = "Delimiter between `namespace`, `stage`, `name` and `attributes`" 24 | } 25 | 26 | output "attributes" { 27 | value = local.attributes 28 | description = "Normalized attributes" 29 | } 30 | 31 | output "tags" { 32 | value = local.tags 33 | description = "Normalized Tag map" 34 | } 35 | -------------------------------------------------------------------------------- /terraform.v12/vpc+application-load-balancer-ec2-role/environment/dev/variables.tf: -------------------------------------------------------------------------------- 1 | #variable "rds-secret" { type = string } 2 | -------------------------------------------------------------------------------- /terraform.v12/vpc+application-load-balancer-ec2-role/modules/aws-alb-tg/main.tf: -------------------------------------------------------------------------------- 1 | resource "aws_lb_target_group" "alb-tg" { 2 | name = var.alb-tg-name 3 | port = var.target-group-port 4 | protocol = var.target-group-protocol 5 | vpc_id = var.vpc-id 6 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+application-load-balancer-ec2-role/modules/aws-alb-tg/output.tf: -------------------------------------------------------------------------------- 1 | output "target-group-arn" { 2 | value = aws_lb_target_group.alb-tg.arn 3 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+application-load-balancer-ec2-role/modules/aws-alb-tg/variables.tf: -------------------------------------------------------------------------------- 1 | variable "alb-tg-name" { 2 | default = "" 3 | } 4 | variable "target-group-port" { 5 | default = "" 6 | } 7 | 8 | variable "target-group-protocol" { 9 | default = "" 10 | } 11 | 12 | variable "vpc-id" { 13 | default = "" 14 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+application-load-balancer-ec2-role/modules/aws-alb/output.tf: -------------------------------------------------------------------------------- 1 | #OUTPUT 2 | output "aws-alb" { 3 | value = aws_lb.alb.id 4 | } 5 | 6 | -------------------------------------------------------------------------------- /terraform.v12/vpc+application-load-balancer-ec2-role/modules/aws-alb/variable.tf: -------------------------------------------------------------------------------- 1 | #ALB VARIABLES 2 | 3 | variable "alb-name" { 4 | default = "" 5 | } 6 | 7 | variable "internal" { 8 | default = "" 9 | } 10 | 11 | variable "alb-sg" { 12 | default = "" 13 | } 14 | 15 | variable "alb-subnets" { 16 | type = list(string) 17 | } 18 | 19 | variable "alb-tag" { 20 | default = "" 21 | } 22 | 23 | variable "target-group-arn" { 24 | default = "" 25 | } 26 | 27 | variable "certificate-arn" { 28 | default = "" 29 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+application-load-balancer-ec2-role/modules/aws-sg-cidr-v2/maint.tf: -------------------------------------------------------------------------------- 1 | ######### 2 | # Labels 3 | ######## 4 | module "label" { 5 | source = "../terraform-label" 6 | namespace = var.namespace 7 | name = var.name 8 | stage = var.stage 9 | delimiter = var.delimiter 10 | attributes = var.attributes 11 | tags = var.tags 12 | enabled = var.enabled 13 | } 14 | 15 | 16 | resource "aws_security_group" "internal" { 17 | 18 | name = var.security_group_name 19 | vpc_id = var.vpcID 20 | 21 | dynamic "ingress" { 22 | for_each = var.ServicePorts 23 | content { 24 | from_port = ingress.value 25 | to_port = ingress.value 26 | protocol = "tcp" 27 | cidr_blocks = [var.cidr] 28 | } 29 | } 30 | 31 | egress { 32 | from_port = 0 33 | to_port = 0 34 | protocol = "-1" 35 | cidr_blocks = ["0.0.0.0/0"] 36 | } 37 | 38 | tags = module.label.tags 39 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+application-load-balancer-ec2-role/modules/aws-sg-cidr-v2/output.tf: -------------------------------------------------------------------------------- 1 | output "aws_security_group_default" { 2 | value = aws_security_group.internal.id 3 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+application-load-balancer-ec2-role/modules/aws-sg-cidr/output.tf: -------------------------------------------------------------------------------- 1 | output "aws_security_group_default" { 2 | value = aws_security_group.default.id 3 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+application-load-balancer-ec2-role/modules/aws-sg-ref-v2/output.tf: -------------------------------------------------------------------------------- 1 | output "aws_security_group_default" { 2 | value = aws_security_group.default.id 3 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+application-load-balancer-ec2-role/modules/aws-sg-ref/output.tf: -------------------------------------------------------------------------------- 1 | output "aws_security_group_default" { 2 | value = aws_security_group.default.id 3 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+application-load-balancer-ec2-role/modules/terraform-label/outputs.tf: -------------------------------------------------------------------------------- 1 | output "id" { 2 | value = local.id 3 | description = "Disambiguated ID" 4 | } 5 | 6 | output "name" { 7 | value = local.name 8 | description = "Normalized name" 9 | } 10 | 11 | output "namespace" { 12 | value = local.namespace 13 | description = "Normalized namespace" 14 | } 15 | 16 | output "stage" { 17 | value = local.stage 18 | description = "Normalized stage" 19 | } 20 | 21 | output "delimiter" { 22 | value = local.delimiter 23 | description = "Delimiter between `namespace`, `stage`, `name` and `attributes`" 24 | } 25 | 26 | output "attributes" { 27 | value = local.attributes 28 | description = "Normalized attributes" 29 | } 30 | 31 | output "tags" { 32 | value = local.tags 33 | description = "Normalized Tag map" 34 | } 35 | -------------------------------------------------------------------------------- /terraform.v12/vpc+application-load-balancer/environment/dev/variables.tf: -------------------------------------------------------------------------------- 1 | #variable "rds-secret" { type = string } 2 | -------------------------------------------------------------------------------- /terraform.v12/vpc+application-load-balancer/environment/dev/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_version = "~> 0.12.0" 3 | } 4 | -------------------------------------------------------------------------------- /terraform.v12/vpc+application-load-balancer/modules/aws-alb-tg/main.tf: -------------------------------------------------------------------------------- 1 | resource "aws_lb_target_group" "alb-tg" { 2 | name = var.alb-tg-name 3 | port = var.target-group-port 4 | protocol = var.target-group-protocol 5 | vpc_id = var.vpc-id 6 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+application-load-balancer/modules/aws-alb-tg/output.tf: -------------------------------------------------------------------------------- 1 | output "target-group-arn" { 2 | value = aws_lb_target_group.alb-tg.arn 3 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+application-load-balancer/modules/aws-alb-tg/variables.tf: -------------------------------------------------------------------------------- 1 | variable "alb-tg-name" { 2 | default = "" 3 | } 4 | variable "target-group-port" { 5 | default = "" 6 | } 7 | 8 | variable "target-group-protocol" { 9 | default = "" 10 | } 11 | 12 | variable "vpc-id" { 13 | default = "" 14 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+application-load-balancer/modules/aws-alb/output.tf: -------------------------------------------------------------------------------- 1 | #OUTPUT 2 | output "aws-alb" { 3 | value = aws_lb.alb.id 4 | } 5 | 6 | -------------------------------------------------------------------------------- /terraform.v12/vpc+application-load-balancer/modules/aws-alb/variable.tf: -------------------------------------------------------------------------------- 1 | #ALB VARIABLES 2 | 3 | variable "alb-name" { 4 | default = "" 5 | } 6 | 7 | variable "internal" { 8 | default = "" 9 | } 10 | 11 | variable "alb-sg" { 12 | default = "" 13 | } 14 | 15 | variable "alb-subnets" { 16 | type = list(string) 17 | } 18 | 19 | variable "alb-tag" { 20 | default = "" 21 | } 22 | 23 | variable "target-group-arn" { 24 | default = "" 25 | } 26 | 27 | variable "certificate-arn" { 28 | default = "" 29 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+application-load-balancer/modules/aws-sg-cidr-v2/maint.tf: -------------------------------------------------------------------------------- 1 | ######### 2 | # Labels 3 | ######## 4 | module "label" { 5 | source = "../terraform-label" 6 | namespace = var.namespace 7 | name = var.name 8 | stage = var.stage 9 | delimiter = var.delimiter 10 | attributes = var.attributes 11 | tags = var.tags 12 | enabled = var.enabled 13 | } 14 | 15 | 16 | resource "aws_security_group" "internal" { 17 | 18 | name = var.security_group_name 19 | vpc_id = var.vpcID 20 | 21 | dynamic "ingress" { 22 | for_each = var.ServicePorts 23 | content { 24 | from_port = ingress.value 25 | to_port = ingress.value 26 | protocol = "tcp" 27 | cidr_blocks = [var.cidr] 28 | } 29 | } 30 | 31 | egress { 32 | from_port = 0 33 | to_port = 0 34 | protocol = "-1" 35 | cidr_blocks = ["0.0.0.0/0"] 36 | } 37 | 38 | tags = module.label.tags 39 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+application-load-balancer/modules/aws-sg-cidr-v2/output.tf: -------------------------------------------------------------------------------- 1 | output "aws_security_group_default" { 2 | value = aws_security_group.internal.id 3 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+application-load-balancer/modules/aws-sg-cidr/output.tf: -------------------------------------------------------------------------------- 1 | output "aws_security_group_default" { 2 | value = aws_security_group.default.id 3 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+application-load-balancer/modules/aws-sg-ref-v2/output.tf: -------------------------------------------------------------------------------- 1 | output "aws_security_group_default" { 2 | value = aws_security_group.default.id 3 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+application-load-balancer/modules/aws-sg-ref/output.tf: -------------------------------------------------------------------------------- 1 | output "aws_security_group_default" { 2 | value = aws_security_group.default.id 3 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+application-load-balancer/modules/terraform-label/outputs.tf: -------------------------------------------------------------------------------- 1 | output "id" { 2 | value = local.id 3 | description = "Disambiguated ID" 4 | } 5 | 6 | output "name" { 7 | value = local.name 8 | description = "Normalized name" 9 | } 10 | 11 | output "namespace" { 12 | value = local.namespace 13 | description = "Normalized namespace" 14 | } 15 | 16 | output "stage" { 17 | value = local.stage 18 | description = "Normalized stage" 19 | } 20 | 21 | output "delimiter" { 22 | value = local.delimiter 23 | description = "Delimiter between `namespace`, `stage`, `name` and `attributes`" 24 | } 25 | 26 | output "attributes" { 27 | value = local.attributes 28 | description = "Normalized attributes" 29 | } 30 | 31 | output "tags" { 32 | value = local.tags 33 | description = "Normalized Tag map" 34 | } 35 | -------------------------------------------------------------------------------- /terraform.v12/vpc+ec2-nodejs/aws/environment/dev/nodejs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash 4 | 5 | . ~/.nvm/nvm.sh 6 | 7 | nvm install node 8 | 9 | node -e "console.log('Running Node.js ' + process.version)" -------------------------------------------------------------------------------- /terraform.v12/vpc+ec2-nodejs/aws/environment/dev/variables.tf: -------------------------------------------------------------------------------- 1 | #variable "rds-secret" { type = string } 2 | -------------------------------------------------------------------------------- /terraform.v12/vpc+ec2-nodejs/aws/environment/dev/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_version = "~> 0.12.0" 3 | } 4 | -------------------------------------------------------------------------------- /terraform.v12/vpc+ec2-nodejs/aws/modules/aws-ec2-keypair/main.tf: -------------------------------------------------------------------------------- 1 | 2 | ######### 3 | # Labels 4 | ######## 5 | module "label" { 6 | source = "../terraform-label" 7 | namespace = var.namespace 8 | name = var.name 9 | stage = var.stage 10 | delimiter = var.delimiter 11 | attributes = var.attributes 12 | tags = var.tags 13 | enabled = var.enabled 14 | } 15 | 16 | resource "aws_key_pair" "keypair" { 17 | key_name = var.key-name 18 | public_key = var.public-key 19 | } 20 | -------------------------------------------------------------------------------- /terraform.v12/vpc+ec2-nodejs/aws/modules/aws-ec2-keypair/output.tf: -------------------------------------------------------------------------------- 1 | #OUTPUT EC2 KEYPAIR 2 | output "key-pair" { 3 | value = aws_key_pair.keypair.id 4 | } 5 | 6 | output "key-name" { 7 | value = aws_key_pair.keypair.key_name 8 | } 9 | 10 | output "public-key" { 11 | value = aws_key_pair.keypair.public_key 12 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+ec2-nodejs/aws/modules/aws-ec2/user-data/nodejs/user-data.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #Purpose: NodeJs Setup 3 | #App: nodejs 4 | #OS AmazonLinux 5 | #Maintainer DevOps Muhammad Asim 6 | 7 | # nodejs Setup 8 | 9 | curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash 10 | 11 | . ~/.nvm/nvm.sh 12 | 13 | nvm install node 14 | 15 | node -e "console.log('Running Node.js ' + process.version)" 16 | 17 | 18 | 19 | #END 20 | -------------------------------------------------------------------------------- /terraform.v12/vpc+ec2-nodejs/aws/modules/aws-sg-cidr-v2/maint.tf: -------------------------------------------------------------------------------- 1 | ######### 2 | # Labels 3 | ######## 4 | module "label" { 5 | source = "../terraform-label" 6 | namespace = var.namespace 7 | name = var.name 8 | stage = var.stage 9 | delimiter = var.delimiter 10 | attributes = var.attributes 11 | tags = var.tags 12 | enabled = var.enabled 13 | } 14 | 15 | 16 | resource "aws_security_group" "internal" { 17 | 18 | name = var.security_group_name 19 | vpc_id = var.vpcID 20 | 21 | dynamic "ingress" { 22 | for_each = var.ServicePorts 23 | content { 24 | from_port = ingress.value 25 | to_port = ingress.value 26 | protocol = "tcp" 27 | cidr_blocks = [var.cidr] 28 | } 29 | } 30 | 31 | egress { 32 | from_port = 0 33 | to_port = 0 34 | protocol = "-1" 35 | cidr_blocks = ["0.0.0.0/0"] 36 | } 37 | 38 | tags = module.label.tags 39 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+ec2-nodejs/aws/modules/aws-sg-cidr-v2/output.tf: -------------------------------------------------------------------------------- 1 | output "aws_security_group_default" { 2 | value = aws_security_group.internal.id 3 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+ec2-nodejs/aws/modules/aws-sg-cidr/output.tf: -------------------------------------------------------------------------------- 1 | output "aws_security_group_default" { 2 | value = aws_security_group.default.id 3 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+ec2-nodejs/aws/modules/aws-sg-ref-v2/output.tf: -------------------------------------------------------------------------------- 1 | output "aws_security_group_default" { 2 | value = aws_security_group.default.id 3 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+ec2-nodejs/aws/modules/aws-sg-ref/output.tf: -------------------------------------------------------------------------------- 1 | output "aws_security_group_default" { 2 | value = aws_security_group.default.id 3 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+ec2-nodejs/aws/modules/aws-sg-requirement/output.tf: -------------------------------------------------------------------------------- 1 | output "aws_security_group" { 2 | value = aws_security_group.security_group.id 3 | } 4 | -------------------------------------------------------------------------------- /terraform.v12/vpc+ec2-nodejs/aws/modules/eip/nodejs/main.tf: -------------------------------------------------------------------------------- 1 | resource "aws_eip" "default" { 2 | vpc = var.vpc 3 | instance = var.instance 4 | network_interface = var.network_interface 5 | associate_with_private_ip = var.associate_with_private_ip 6 | public_ipv4_pool = var.public_ipv4_pool 7 | 8 | tags = merge(var.tags, { "Name" = var.name }) 9 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+ec2-nodejs/aws/modules/eip/nodejs/output.tf: -------------------------------------------------------------------------------- 1 | output "id" { 2 | description = "Contains the EIP allocation ID" 3 | value = aws_eip.default.id 4 | } 5 | 6 | output "public_ip" { 7 | description = "Contains the public IP address" 8 | value = aws_eip.default.public_ip 9 | } 10 | 11 | output "public_dns" { 12 | description = "Public DNS associated with the Elastic IP address" 13 | value = aws_eip.default.public_dns 14 | } 15 | -------------------------------------------------------------------------------- /terraform.v12/vpc+ec2-nodejs/aws/modules/secrets/nodejs.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDJW/8Lz5DA/Yx4wcOhEICQj8jPpppzBq6dIooFNcp9HEU6x3N/7F/hstco/Oz4qtBJUrEM5hke58vt715MJuRwJ68idoa3Q82eBI03DTJwMmfbg19s2ibumyoa4Ei+bcap/NSLmzVRkTZW8/IG6POw7vaykpQ5Ywd7A0vP+Ep4AcJtqcLo6E/ZsdlftZ/i3iW7RbHE1siBYYh1CknttphQfZBKhtI84gOE9zaFz1ZHESwhIagzdKmIiEJf0r1dfGNigvk1T7gzdWs8BYqbPxjDY1zdO8XVz3fQH3bP3N8Xrn2WmpKB1ZqvHCmAWdWV+fodXJiBj6Z261CZKSFfWFPpe9zNTM9Ofpv0yc96T4IlNr1OK8QMPfeCKtGSNfHStP7m9QGMZmzc2WpfsJtcx9wUNBeLG9mladmHknN2rZ+9tfjqQ2nCdTVmvbMyOu/+lZ7d5FzCA9Ze+wZ5Hm47KdSEyJod9sRExdNcT1c/0ARUclwAxtu6CDxTfFspH6EkMAs= Muhammad Asim@DESKTOP-3MFKCUC 2 | -------------------------------------------------------------------------------- /terraform.v12/vpc+ec2-nodejs/aws/modules/terraform-label/outputs.tf: -------------------------------------------------------------------------------- 1 | output "id" { 2 | value = local.id 3 | description = "Disambiguated ID" 4 | } 5 | 6 | output "name" { 7 | value = local.name 8 | description = "Normalized name" 9 | } 10 | 11 | output "namespace" { 12 | value = local.namespace 13 | description = "Normalized namespace" 14 | } 15 | 16 | output "stage" { 17 | value = local.stage 18 | description = "Normalized stage" 19 | } 20 | 21 | output "delimiter" { 22 | value = local.delimiter 23 | description = "Delimiter between `namespace`, `stage`, `name` and `attributes`" 24 | } 25 | 26 | output "attributes" { 27 | value = local.attributes 28 | description = "Normalized attributes" 29 | } 30 | 31 | output "tags" { 32 | value = local.tags 33 | description = "Normalized Tag map" 34 | } 35 | -------------------------------------------------------------------------------- /terraform.v12/vpc+ec2-zabbix+ec2-grafana/Windows-PEM-Format-Requirement.txt: -------------------------------------------------------------------------------- 1 | # Example 2 | ssh-keygen -p -m PEM -f monitoring -------------------------------------------------------------------------------- /terraform.v12/vpc+ec2-zabbix+ec2-grafana/aws/environment/dev/variables.tf: -------------------------------------------------------------------------------- 1 | #variable "rds-secret" { type = string } 2 | -------------------------------------------------------------------------------- /terraform.v12/vpc+ec2-zabbix+ec2-grafana/aws/environment/dev/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_version = "~> 0.12.0" 3 | } 4 | -------------------------------------------------------------------------------- /terraform.v12/vpc+ec2-zabbix+ec2-grafana/aws/modules/aws-ec2-keypair/main.tf: -------------------------------------------------------------------------------- 1 | 2 | ######### 3 | # Labels 4 | ######## 5 | module "label" { 6 | source = "../terraform-label" 7 | namespace = var.namespace 8 | name = var.name 9 | stage = var.stage 10 | delimiter = var.delimiter 11 | attributes = var.attributes 12 | tags = var.tags 13 | enabled = var.enabled 14 | } 15 | 16 | resource "aws_key_pair" "keypair" { 17 | key_name = var.key-name 18 | public_key = var.public-key 19 | } 20 | -------------------------------------------------------------------------------- /terraform.v12/vpc+ec2-zabbix+ec2-grafana/aws/modules/aws-ec2-keypair/output.tf: -------------------------------------------------------------------------------- 1 | #OUTPUT EC2 KEYPAIR 2 | output "key-pair" { 3 | value = aws_key_pair.keypair.id 4 | } 5 | 6 | output "key-name" { 7 | value = aws_key_pair.keypair.key_name 8 | } 9 | 10 | output "public-key" { 11 | value = aws_key_pair.keypair.public_key 12 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+ec2-zabbix+ec2-grafana/aws/modules/aws-sg-cidr-v2/maint.tf: -------------------------------------------------------------------------------- 1 | ######### 2 | # Labels 3 | ######## 4 | module "label" { 5 | source = "../terraform-label" 6 | namespace = var.namespace 7 | name = var.name 8 | stage = var.stage 9 | delimiter = var.delimiter 10 | attributes = var.attributes 11 | tags = var.tags 12 | enabled = var.enabled 13 | } 14 | 15 | 16 | resource "aws_security_group" "internal" { 17 | 18 | name = var.security_group_name 19 | vpc_id = var.vpcID 20 | 21 | dynamic "ingress" { 22 | for_each = var.ServicePorts 23 | content { 24 | from_port = ingress.value 25 | to_port = ingress.value 26 | protocol = "tcp" 27 | cidr_blocks = [var.cidr] 28 | } 29 | } 30 | 31 | egress { 32 | from_port = 0 33 | to_port = 0 34 | protocol = "-1" 35 | cidr_blocks = ["0.0.0.0/0"] 36 | } 37 | 38 | tags = module.label.tags 39 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+ec2-zabbix+ec2-grafana/aws/modules/aws-sg-cidr-v2/output.tf: -------------------------------------------------------------------------------- 1 | output "aws_security_group_default" { 2 | value = aws_security_group.internal.id 3 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+ec2-zabbix+ec2-grafana/aws/modules/aws-sg-cidr/output.tf: -------------------------------------------------------------------------------- 1 | output "aws_security_group_default" { 2 | value = aws_security_group.default.id 3 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+ec2-zabbix+ec2-grafana/aws/modules/aws-sg-ref-v2/output.tf: -------------------------------------------------------------------------------- 1 | output "aws_security_group_default" { 2 | value = aws_security_group.default.id 3 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+ec2-zabbix+ec2-grafana/aws/modules/aws-sg-ref/output.tf: -------------------------------------------------------------------------------- 1 | output "aws_security_group_default" { 2 | value = aws_security_group.default.id 3 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+ec2-zabbix+ec2-grafana/aws/modules/aws-sg-requirement/output.tf: -------------------------------------------------------------------------------- 1 | output "aws_security_group" { 2 | value = aws_security_group.security_group.id 3 | } 4 | -------------------------------------------------------------------------------- /terraform.v12/vpc+ec2-zabbix+ec2-grafana/aws/modules/eip/grafana/main.tf: -------------------------------------------------------------------------------- 1 | resource "aws_eip" "default" { 2 | vpc = var.vpc 3 | instance = var.instance 4 | network_interface = var.network_interface 5 | associate_with_private_ip = var.associate_with_private_ip 6 | public_ipv4_pool = var.public_ipv4_pool 7 | 8 | tags = merge(var.tags, { "Name" = var.name }) 9 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+ec2-zabbix+ec2-grafana/aws/modules/eip/grafana/output.tf: -------------------------------------------------------------------------------- 1 | output "id" { 2 | description = "Contains the EIP allocation ID" 3 | value = aws_eip.default.id 4 | } 5 | 6 | output "public_ip" { 7 | description = "Contains the public IP address" 8 | value = aws_eip.default.public_ip 9 | } 10 | 11 | output "public_dns" { 12 | description = "Public DNS associated with the Elastic IP address" 13 | value = aws_eip.default.public_dns 14 | } 15 | -------------------------------------------------------------------------------- /terraform.v12/vpc+ec2-zabbix+ec2-grafana/aws/modules/eip/zabbix/main.tf: -------------------------------------------------------------------------------- 1 | resource "aws_eip" "default" { 2 | vpc = var.vpc 3 | instance = var.instance 4 | network_interface = var.network_interface 5 | associate_with_private_ip = var.associate_with_private_ip 6 | public_ipv4_pool = var.public_ipv4_pool 7 | 8 | tags = merge(var.tags, { "Name" = var.name }) 9 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+ec2-zabbix+ec2-grafana/aws/modules/eip/zabbix/output.tf: -------------------------------------------------------------------------------- 1 | output "id" { 2 | description = "Contains the EIP allocation ID" 3 | value = aws_eip.default.id 4 | } 5 | 6 | output "public_ip" { 7 | description = "Contains the public IP address" 8 | value = aws_eip.default.public_ip 9 | } 10 | 11 | output "public_dns" { 12 | description = "Public DNS associated with the Elastic IP address" 13 | value = aws_eip.default.public_dns 14 | } 15 | -------------------------------------------------------------------------------- /terraform.v12/vpc+ec2-zabbix+ec2-grafana/aws/modules/secrets/monitoring.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCX64hJyek1sA0X3BgdreSPKX6z2zuC8kI/Cu2IBndqDiwjUVzHgYmlh+MHhMVtwMwsGTfwMuJYBrP6IIBTlv5/r1rAOxm36fTmCZi7QlFd3Gom59Bp136AHv2Zl/PLvHUws7vRJm6/OP4j4ME/UobsHBPcYNNpQNqOSjtdSBZxkDDhX6x64lxswelfpP4ajt9FT4LP6CV+2OoL8hcGZLoZvzbthz90A/pAg92ubFFguy9V/VOc0dAwCAmvK8DgYBRLiJkNnKLOm5weZ6CYmydgGYd+uPi9aWRj1eIRjqXzJbm7M7D60SUo3Up8bewedsqy36k3QVEr423x1c15zzSuKoriAer5FCOf7CpU/tCyT93F5xP3JdOglqEzckkKG4o12k+IDfGKMR6pD9lOXvXwZ9aq1vza0h/JHZCzLNS+7fdNmeyqD9/hae4WtA9TMrErEcTreFXzzrkf16v760FtY2b3ONPHaAH5ZQhu0IatXL0nsAX2hak4IB2GG9M8dmk= Muhammad Asim@DESKTOP-N7P5RL0 2 | -------------------------------------------------------------------------------- /terraform.v12/vpc+ec2-zabbix+ec2-grafana/aws/modules/terraform-label/outputs.tf: -------------------------------------------------------------------------------- 1 | output "id" { 2 | value = local.id 3 | description = "Disambiguated ID" 4 | } 5 | 6 | output "name" { 7 | value = local.name 8 | description = "Normalized name" 9 | } 10 | 11 | output "namespace" { 12 | value = local.namespace 13 | description = "Normalized namespace" 14 | } 15 | 16 | output "stage" { 17 | value = local.stage 18 | description = "Normalized stage" 19 | } 20 | 21 | output "delimiter" { 22 | value = local.delimiter 23 | description = "Delimiter between `namespace`, `stage`, `name` and `attributes`" 24 | } 25 | 26 | output "attributes" { 27 | value = local.attributes 28 | description = "Normalized attributes" 29 | } 30 | 31 | output "tags" { 32 | value = local.tags 33 | description = "Normalized Tag map" 34 | } 35 | -------------------------------------------------------------------------------- /terraform.v12/vpc+ec2-zabbix+ec2-grafana/grafana-link-zabbix: -------------------------------------------------------------------------------- 1 | # Zabbix API 2 | # http://privateip/api_jsonrpc.php # Eg: http://10.20.1.20/api_jsonrpc.php 3 | # http://127.0.0.1/zabbix/api_jsonrpc.php # Eg: http://172.31.10.4/zabbix/api_jsonrpc.php 4 | -------------------------------------------------------------------------------- /terraform.v12/vpc+ec2-zabbix+ec2-grafana/zabbix-agent-windows/bin/zabbix_agentd.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quickbooks2018/Terraform-V-12/1232e64251afc07495e9cc03d01bed3cf8d46050/terraform.v12/vpc+ec2-zabbix+ec2-grafana/zabbix-agent-windows/bin/zabbix_agentd.exe -------------------------------------------------------------------------------- /terraform.v12/vpc+ec2-zabbix+ec2-grafana/zabbix-agent-windows/bin/zabbix_get.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quickbooks2018/Terraform-V-12/1232e64251afc07495e9cc03d01bed3cf8d46050/terraform.v12/vpc+ec2-zabbix+ec2-grafana/zabbix-agent-windows/bin/zabbix_get.exe -------------------------------------------------------------------------------- /terraform.v12/vpc+ec2-zabbix+ec2-grafana/zabbix-agent-windows/bin/zabbix_sender.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quickbooks2018/Terraform-V-12/1232e64251afc07495e9cc03d01bed3cf8d46050/terraform.v12/vpc+ec2-zabbix+ec2-grafana/zabbix-agent-windows/bin/zabbix_sender.exe -------------------------------------------------------------------------------- /terraform.v12/vpc+ec2-zabbix+ec2-grafana/zabbix-agent-windows/zabbix/zabbix_agentd.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quickbooks2018/Terraform-V-12/1232e64251afc07495e9cc03d01bed3cf8d46050/terraform.v12/vpc+ec2-zabbix+ec2-grafana/zabbix-agent-windows/zabbix/zabbix_agentd.exe -------------------------------------------------------------------------------- /terraform.v12/vpc+ec2-zabbix+ec2-grafana/zabbix-agent-windows/zabbix_agent-4.4.5-windows-amd64-openssl.msi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quickbooks2018/Terraform-V-12/1232e64251afc07495e9cc03d01bed3cf8d46050/terraform.v12/vpc+ec2-zabbix+ec2-grafana/zabbix-agent-windows/zabbix_agent-4.4.5-windows-amd64-openssl.msi -------------------------------------------------------------------------------- /terraform.v12/vpc+ec2-zabbix+ec2-grafana/zabbix-agent-windows/zabbix_agent-5.0.0-windows-amd64-openssl.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quickbooks2018/Terraform-V-12/1232e64251afc07495e9cc03d01bed3cf8d46050/terraform.v12/vpc+ec2-zabbix+ec2-grafana/zabbix-agent-windows/zabbix_agent-5.0.0-windows-amd64-openssl.zip -------------------------------------------------------------------------------- /terraform.v12/vpc+ec2-zabbix+ec2-grafana/zabbix-notes/Zabbix-Admin User & AWS-SES-Email-Configuration.txt: -------------------------------------------------------------------------------- 1 | ### Administration ### 2 | # Users 3 | password ---> Admin zabbix 4 | default ---> Guests ---> disabled 5 | Admin ---> Administrator ---> enabled 6 | 7 | # Change Admin password 8 | 9 | # Email 10 | # https://www.gmass.co/smtp-test 11 | # https://docs.aws.amazon.com/ses/latest/DeveloperGuide/request-production-access.html 12 | 13 | 14 | -------------------------------------------------------------------------------- /terraform.v12/vpc+jenkins-ec2/aws/environment/dev/variables.tf: -------------------------------------------------------------------------------- 1 | #variable "rds-secret" { type = string } 2 | -------------------------------------------------------------------------------- /terraform.v12/vpc+jenkins-ec2/aws/environment/dev/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_version = "~> 0.12.0" 3 | } 4 | -------------------------------------------------------------------------------- /terraform.v12/vpc+jenkins-ec2/aws/modules/aws-ec2-keypair/main.tf: -------------------------------------------------------------------------------- 1 | #Creating EC2-Key Pair 2 | provider "aws" { 3 | region = var.region 4 | } 5 | 6 | ######### 7 | # Labels 8 | ######## 9 | module "label" { 10 | source = "../terraform-label" 11 | namespace = var.namespace 12 | name = var.name 13 | stage = var.stage 14 | delimiter = var.delimiter 15 | attributes = var.attributes 16 | tags = var.tags 17 | enabled = var.enabled 18 | } 19 | 20 | resource "aws_key_pair" "keypair" { 21 | key_name = var.key-name 22 | public_key = var.public-key 23 | } 24 | -------------------------------------------------------------------------------- /terraform.v12/vpc+jenkins-ec2/aws/modules/aws-ec2-keypair/output.tf: -------------------------------------------------------------------------------- 1 | #OUTPUT EC2 KEYPAIR 2 | output "key-pair" { 3 | value = aws_key_pair.keypair.id 4 | } 5 | 6 | output "key-name" { 7 | value = aws_key_pair.keypair.key_name 8 | } 9 | 10 | output "public-key" { 11 | value = aws_key_pair.keypair.public_key 12 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+jenkins-ec2/aws/modules/aws-ec2-keypair/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_version = "~> 0.12.0" 3 | } 4 | -------------------------------------------------------------------------------- /terraform.v12/vpc+jenkins-ec2/aws/modules/aws-sg-cidr-v2/maint.tf: -------------------------------------------------------------------------------- 1 | ######### 2 | # Labels 3 | ######## 4 | module "label" { 5 | source = "../terraform-label" 6 | namespace = var.namespace 7 | name = var.name 8 | stage = var.stage 9 | delimiter = var.delimiter 10 | attributes = var.attributes 11 | tags = var.tags 12 | enabled = var.enabled 13 | } 14 | 15 | 16 | resource "aws_security_group" "internal" { 17 | 18 | name = var.security_group_name 19 | vpc_id = var.vpcID 20 | 21 | dynamic "ingress" { 22 | for_each = var.ServicePorts 23 | content { 24 | from_port = ingress.value 25 | to_port = ingress.value 26 | protocol = "tcp" 27 | cidr_blocks = [var.cidr] 28 | } 29 | } 30 | 31 | egress { 32 | from_port = 0 33 | to_port = 0 34 | protocol = "-1" 35 | cidr_blocks = ["0.0.0.0/0"] 36 | } 37 | 38 | tags = module.label.tags 39 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+jenkins-ec2/aws/modules/aws-sg-cidr-v2/output.tf: -------------------------------------------------------------------------------- 1 | output "aws_security_group_default" { 2 | value = aws_security_group.internal.id 3 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+jenkins-ec2/aws/modules/aws-sg-cidr/output.tf: -------------------------------------------------------------------------------- 1 | output "aws_security_group_default" { 2 | value = aws_security_group.default.id 3 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+jenkins-ec2/aws/modules/aws-sg-ref-v2/output.tf: -------------------------------------------------------------------------------- 1 | output "aws_security_group_default" { 2 | value = aws_security_group.default.id 3 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+jenkins-ec2/aws/modules/aws-sg-ref/output.tf: -------------------------------------------------------------------------------- 1 | output "aws_security_group_default" { 2 | value = aws_security_group.default.id 3 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+jenkins-ec2/aws/modules/aws-sg-requirement/output.tf: -------------------------------------------------------------------------------- 1 | output "aws_security_group" { 2 | value = aws_security_group.security_group.id 3 | } 4 | -------------------------------------------------------------------------------- /terraform.v12/vpc+jenkins-ec2/aws/modules/eip/jenkins/main.tf: -------------------------------------------------------------------------------- 1 | resource "aws_eip" "default" { 2 | vpc = var.vpc 3 | instance = var.instance 4 | network_interface = var.network_interface 5 | associate_with_private_ip = var.associate_with_private_ip 6 | public_ipv4_pool = var.public_ipv4_pool 7 | 8 | tags = merge(var.tags, { "Name" = var.name }) 9 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+jenkins-ec2/aws/modules/eip/jenkins/output.tf: -------------------------------------------------------------------------------- 1 | output "id" { 2 | description = "Contains the EIP allocation ID" 3 | value = aws_eip.default.id 4 | } 5 | 6 | output "public_ip" { 7 | description = "Contains the public IP address" 8 | value = aws_eip.default.public_ip 9 | } 10 | 11 | output "public_dns" { 12 | description = "Public DNS associated with the Elastic IP address" 13 | value = aws_eip.default.public_dns 14 | } 15 | -------------------------------------------------------------------------------- /terraform.v12/vpc+jenkins-ec2/aws/modules/secrets/jenkins-demo.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCuBCXOpfpCxbFjwbUKssnqr3O8LKtVgxUMjungPGygk85ptKTm5wFLu9Rt/ZSZrw4pnR1B7o9bLOEsYkSrcamI4oI5O+5C8bsFAcrq5rZ+IFpMS1Z2yORyvWqdKLWSfkM/jGcS53P/St/Wv1pM9EdQS3k6bcdrClcKEe+bk1w935UqUPHasm7gatX4z67ulCb0SqRC4J/yv3R6qHlsOAdLXIDIaED39KN8f424AgPGqi/MEi+zXmUAI+l6c1uD07RcaeeNiFneAC1R07AXpX+8XKJWYi+iUw34scsl5/Ed6oG9s2Mdp7UMvC78/vzA6l6R7BPveGHz+yO73L/gZ7631vMDD1Gmf7s+zbYAYuJxehpssSeTWFbD431eq0x02bK8/xXPSyLPo/90P+e6oMNkxhifMqMTaeN2MnEjTaHpzZrL19V2ut5PzUNIi4x21kYQU+oxrpawiESEDh+LuwhoojNlm5RwmjMwObZavrwtXfWEQH+xxTBMn3cWqgutHqM= 2 | -------------------------------------------------------------------------------- /terraform.v12/vpc+jenkins-ec2/aws/modules/terraform-label/outputs.tf: -------------------------------------------------------------------------------- 1 | output "id" { 2 | value = local.id 3 | description = "Disambiguated ID" 4 | } 5 | 6 | output "name" { 7 | value = local.name 8 | description = "Normalized name" 9 | } 10 | 11 | output "namespace" { 12 | value = local.namespace 13 | description = "Normalized namespace" 14 | } 15 | 16 | output "stage" { 17 | value = local.stage 18 | description = "Normalized stage" 19 | } 20 | 21 | output "delimiter" { 22 | value = local.delimiter 23 | description = "Delimiter between `namespace`, `stage`, `name` and `attributes`" 24 | } 25 | 26 | output "attributes" { 27 | value = local.attributes 28 | description = "Normalized attributes" 29 | } 30 | 31 | output "tags" { 32 | value = local.tags 33 | description = "Normalized Tag map" 34 | } 35 | -------------------------------------------------------------------------------- /terraform.v12/vpc+tgw/environment/dev1/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_version = "~> 0.12.0" 3 | } 4 | -------------------------------------------------------------------------------- /terraform.v12/vpc+tgw/environment/dev3/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_version = "~> 0.12.0" 3 | } 4 | -------------------------------------------------------------------------------- /terraform.v12/vpc+tgw/modules/aws-ec2-keypair/main.tf: -------------------------------------------------------------------------------- 1 | #Creating EC2-Key Pair 2 | provider "aws" { 3 | region = var.region 4 | } 5 | 6 | ######### 7 | # Labels 8 | ######## 9 | module "label" { 10 | source = "../terraform-label" 11 | namespace = var.namespace 12 | name = var.name 13 | stage = var.stage 14 | delimiter = var.delimiter 15 | attributes = var.attributes 16 | tags = var.tags 17 | enabled = var.enabled 18 | } 19 | 20 | resource "aws_key_pair" "keypair" { 21 | key_name = var.key-name 22 | public_key = var.public-key 23 | } 24 | -------------------------------------------------------------------------------- /terraform.v12/vpc+tgw/modules/aws-ec2-keypair/output.tf: -------------------------------------------------------------------------------- 1 | #OUTPUT EC2 KEYPAIR 2 | output "key-pair" { 3 | value = aws_key_pair.keypair.id 4 | } 5 | 6 | output "key-name" { 7 | value = aws_key_pair.keypair.key_name 8 | } 9 | 10 | output "public-key" { 11 | value = aws_key_pair.keypair.public_key 12 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+tgw/modules/aws-ec2-keypair/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_version = "~> 0.12.0" 3 | } 4 | -------------------------------------------------------------------------------- /terraform.v12/vpc+tgw/modules/aws-sg-cidr-v2/maint.tf: -------------------------------------------------------------------------------- 1 | ######### 2 | # Labels 3 | ######## 4 | module "label" { 5 | source = "../terraform-label" 6 | namespace = var.namespace 7 | name = var.name 8 | stage = var.stage 9 | delimiter = var.delimiter 10 | attributes = var.attributes 11 | tags = var.tags 12 | enabled = var.enabled 13 | } 14 | 15 | 16 | resource "aws_security_group" "internal" { 17 | 18 | name = var.security_group_name 19 | vpc_id = var.vpcID 20 | 21 | dynamic "ingress" { 22 | for_each = var.ServicePorts 23 | content { 24 | from_port = ingress.value 25 | to_port = ingress.value 26 | protocol = "tcp" 27 | cidr_blocks = [var.cidr] 28 | } 29 | } 30 | 31 | egress { 32 | from_port = 0 33 | to_port = 0 34 | protocol = "-1" 35 | cidr_blocks = ["0.0.0.0/0"] 36 | } 37 | 38 | tags = module.label.tags 39 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+tgw/modules/aws-sg-cidr-v2/output.tf: -------------------------------------------------------------------------------- 1 | output "aws_security_group_default" { 2 | value = aws_security_group.internal.id 3 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+tgw/modules/aws-sg-cidr/output.tf: -------------------------------------------------------------------------------- 1 | output "aws_security_group_default" { 2 | value = aws_security_group.default.id 3 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+tgw/modules/aws-sg-ref-v2/output.tf: -------------------------------------------------------------------------------- 1 | output "aws_security_group_default" { 2 | value = aws_security_group.default.id 3 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+tgw/modules/aws-sg-ref/output.tf: -------------------------------------------------------------------------------- 1 | output "aws_security_group_default" { 2 | value = aws_security_group.default.id 3 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+tgw/modules/aws-sg-tgw/output.tf: -------------------------------------------------------------------------------- 1 | output "aws_security_group" { 2 | value = aws_security_group.security_group.id 3 | } 4 | -------------------------------------------------------------------------------- /terraform.v12/vpc+tgw/modules/aws-transit-gateway/output.tf: -------------------------------------------------------------------------------- 1 | output "EC2_Transit_Gateway_Amazon_Resource_Name" { 2 | value = aws_ec2_transit_gateway.aws_ec2_transit_gateway.arn 3 | } 4 | 5 | output "EC2_Transit_Gateway_identifier_ID" { 6 | value = aws_ec2_transit_gateway.aws_ec2_transit_gateway.id 7 | } 8 | 9 | -------------------------------------------------------------------------------- /terraform.v12/vpc+tgw/modules/aws-transit-gateway/variables.tf: -------------------------------------------------------------------------------- 1 | variable "auto_accept_shared_attachments" {} 2 | 3 | variable "amazon_side_asn" {} 4 | 5 | variable "vpn_ecmp_support" {} 6 | 7 | variable "default_route_table_association" {} 8 | 9 | variable "default_route_table_propagation" {} 10 | 11 | variable "dns_support" {} 12 | 13 | variable "transit_gateway_name" {} 14 | 15 | variable "transit_gateway_id" {} 16 | 17 | variable "subnet_ids" {} 18 | 19 | variable "vpc_id" {} 20 | 21 | variable "aws_ec2_transit_gateway_vpc_attachment_name" {} 22 | 23 | variable "transit_gateway_default_route_table_association" {} 24 | 25 | variable "transit_gateway_default_route_table_propagation" {} 26 | 27 | -------------------------------------------------------------------------------- /terraform.v12/vpc+tgw/modules/aws-trasit-gateway-addtional-attachments/main.tf: -------------------------------------------------------------------------------- 1 | # aws_ec2_transit_gateway_vpc_attachment 2 | 3 | resource "aws_ec2_transit_gateway_vpc_attachment" "aws_ec2_transit_gateway_vpc_attachment" { 4 | subnet_ids = var.subnet_ids 5 | transit_gateway_id = var.transit_gateway_id 6 | vpc_id = var.vpc_id 7 | tags = { 8 | Name = var.aws_ec2_transit_gateway_vpc_attachment_name 9 | } 10 | transit_gateway_default_route_table_association = var.transit_gateway_default_route_table_association 11 | transit_gateway_default_route_table_propagation = var.transit_gateway_default_route_table_propagation 12 | 13 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+tgw/modules/aws-trasit-gateway-addtional-attachments/variables.tf: -------------------------------------------------------------------------------- 1 | variable "transit_gateway_id" {} 2 | 3 | variable "subnet_ids" {} 4 | 5 | variable "vpc_id" {} 6 | 7 | variable "aws_ec2_transit_gateway_vpc_attachment_name" {} 8 | 9 | variable "transit_gateway_default_route_table_association" {} 10 | 11 | variable "transit_gateway_default_route_table_propagation" {} 12 | -------------------------------------------------------------------------------- /terraform.v12/vpc+tgw/modules/eip/transit-gateway/main.tf: -------------------------------------------------------------------------------- 1 | resource "aws_eip" "default" { 2 | vpc = var.vpc 3 | instance = var.instance 4 | network_interface = var.network_interface 5 | associate_with_private_ip = var.associate_with_private_ip 6 | public_ipv4_pool = var.public_ipv4_pool 7 | 8 | tags = merge(var.tags, { "Name" = var.name }) 9 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+tgw/modules/eip/transit-gateway/output.tf: -------------------------------------------------------------------------------- 1 | output "id" { 2 | description = "Contains the EIP allocation ID" 3 | value = aws_eip.default.id 4 | } 5 | 6 | output "public_ip" { 7 | description = "Contains the public IP address" 8 | value = aws_eip.default.public_ip 9 | } 10 | 11 | output "public_dns" { 12 | description = "Public DNS associated with the Elastic IP address" 13 | value = aws_eip.default.public_dns 14 | } 15 | -------------------------------------------------------------------------------- /terraform.v12/vpc+tgw/modules/secrets/transit-gateway-home-vpc.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCuBCXOpfpCxbFjwbUKssnqr3O8LKtVgxUMjungPGygk85ptKTm5wFLu9Rt/ZSZrw4pnR1B7o9bLOEsYkSrcamI4oI5O+5C8bsFAcrq5rZ+IFpMS1Z2yORyvWqdKLWSfkM/jGcS53P/St/Wv1pM9EdQS3k6bcdrClcKEe+bk1w935UqUPHasm7gatX4z67ulCb0SqRC4J/yv3R6qHlsOAdLXIDIaED39KN8f424AgPGqi/MEi+zXmUAI+l6c1uD07RcaeeNiFneAC1R07AXpX+8XKJWYi+iUw34scsl5/Ed6oG9s2Mdp7UMvC78/vzA6l6R7BPveGHz+yO73L/gZ7631vMDD1Gmf7s+zbYAYuJxehpssSeTWFbD431eq0x02bK8/xXPSyLPo/90P+e6oMNkxhifMqMTaeN2MnEjTaHpzZrL19V2ut5PzUNIi4x21kYQU+oxrpawiESEDh+LuwhoojNlm5RwmjMwObZavrwtXfWEQH+xxTBMn3cWqgutHqM= 2 | -------------------------------------------------------------------------------- /terraform.v12/vpc+tgw/modules/secrets/transit-gateway.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCuBCXOpfpCxbFjwbUKssnqr3O8LKtVgxUMjungPGygk85ptKTm5wFLu9Rt/ZSZrw4pnR1B7o9bLOEsYkSrcamI4oI5O+5C8bsFAcrq5rZ+IFpMS1Z2yORyvWqdKLWSfkM/jGcS53P/St/Wv1pM9EdQS3k6bcdrClcKEe+bk1w935UqUPHasm7gatX4z67ulCb0SqRC4J/yv3R6qHlsOAdLXIDIaED39KN8f424AgPGqi/MEi+zXmUAI+l6c1uD07RcaeeNiFneAC1R07AXpX+8XKJWYi+iUw34scsl5/Ed6oG9s2Mdp7UMvC78/vzA6l6R7BPveGHz+yO73L/gZ7631vMDD1Gmf7s+zbYAYuJxehpssSeTWFbD431eq0x02bK8/xXPSyLPo/90P+e6oMNkxhifMqMTaeN2MnEjTaHpzZrL19V2ut5PzUNIi4x21kYQU+oxrpawiESEDh+LuwhoojNlm5RwmjMwObZavrwtXfWEQH+xxTBMn3cWqgutHqM= 2 | -------------------------------------------------------------------------------- /terraform.v12/vpc+tgw/modules/terraform-label/main.tf: -------------------------------------------------------------------------------- 1 | locals { 2 | original_tags = join(var.delimiter, compact(concat(list(var.namespace, var.stage, var.name), var.attributes))) 3 | transformed_tags = var.convert_case ? lower(local.original_tags) : local.original_tags 4 | } 5 | 6 | locals { 7 | id = var.enabled ? local.transformed_tags : "" 8 | 9 | name = var.enabled ? (var.convert_case ? lower(format("%v", var.name)) : format("%v", var.name)) : "" 10 | namespace = var.enabled ? (var.convert_case ? lower(format("%v", var.namespace)) : format("%v", var.namespace)) : "" 11 | stage = var.enabled ? (var.convert_case ? lower(format("%v", var.stage)) : format("%v", var.stage)) : "" 12 | delimiter = var.enabled ? (var.convert_case ? lower(format("%v", var.delimiter)) : format("%v", var.delimiter)) : "" 13 | attributes = var.enabled ? (var.convert_case ? lower(format("%v", join(var.delimiter, compact(var.attributes)))) : format("%v", join(var.delimiter, compact(var.attributes)))) : "" 14 | 15 | tags = merge( 16 | { 17 | "Name" = local.id 18 | "Namespace" = local.namespace 19 | "Stage" = local.stage 20 | }, 21 | var.tags 22 | ) 23 | } 24 | -------------------------------------------------------------------------------- /terraform.v12/vpc+tgw/modules/terraform-label/outputs.tf: -------------------------------------------------------------------------------- 1 | output "id" { 2 | value = local.id 3 | description = "Disambiguated ID" 4 | } 5 | 6 | output "name" { 7 | value = local.name 8 | description = "Normalized name" 9 | } 10 | 11 | output "namespace" { 12 | value = local.namespace 13 | description = "Normalized namespace" 14 | } 15 | 16 | output "stage" { 17 | value = local.stage 18 | description = "Normalized stage" 19 | } 20 | 21 | output "delimiter" { 22 | value = local.delimiter 23 | description = "Delimiter between `namespace`, `stage`, `name` and `attributes`" 24 | } 25 | 26 | output "attributes" { 27 | value = local.attributes 28 | description = "Normalized attributes" 29 | } 30 | 31 | output "tags" { 32 | value = local.tags 33 | description = "Normalized Tag map" 34 | } 35 | -------------------------------------------------------------------------------- /terraform.v12/vpc+tgw/tgw-cf/issues.txt: -------------------------------------------------------------------------------- 1 | https://stackoverflow.com/questions/59286839/cloudformation-route-table-route-propagation-for-tansit-gateway -------------------------------------------------------------------------------- /terraform.v12/vpc+tgw/tgw-concept/TGW-Multiple-Region.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quickbooks2018/Terraform-V-12/1232e64251afc07495e9cc03d01bed3cf8d46050/terraform.v12/vpc+tgw/tgw-concept/TGW-Multiple-Region.png -------------------------------------------------------------------------------- /terraform.v12/vpc+tgw/tgw-concept/environment/us-east-1/vpc-1/ec2-console.tf: -------------------------------------------------------------------------------- 1 | resource "aws_iam_instance_profile" "aws-iam-instance-profile" { 2 | name = "ec2-ssm-console-role" 3 | role = aws_iam_role.ec2-role.name 4 | } 5 | 6 | resource "aws_iam_role" "ec2-role" { 7 | name = "ec2-ssm-console-role" 8 | path = "/" 9 | 10 | assume_role_policy = < 6 | # shellcheck disable=SC1072 7 | 8 | Set-Location "C:\Windows\system32" 9 | 10 | #Change TimeZone 11 | C:\Windows\System32\tzutil /s "AUS Eastern Standard Time" 12 | 13 | #Install Chrome 14 | $Path = $env:TEMP; 15 | $Installer = "chrome_installer.exe"; 16 | Invoke-WebRequest "http://dl.google.com/chrome/install/375.126/chrome_installer.exe" -OutFile $Path\$Installer; 17 | Start-Process -FilePath $Path\$Installer -ArgumentList "/silent /install" -Verb RunAs -Wait; 18 | Remove-Item $Path\$Installer 19 | 20 | #Set Chrome as default browser 21 | $chromePath = "${Env:ProgramFiles(x86)}\Google\Chrome\Application\" 22 | $chromeApp = "chrome.exe" 23 | $chromeCommandArgs = "--make-default-browser" 24 | & "$chromePath$chromeApp" $chromeCommandArgs 25 | 26 | 27 | #END 28 | -------------------------------------------------------------------------------- /terraform.v12/vpc+windows/aws/modules/aws-sg-cidr-v2/maint.tf: -------------------------------------------------------------------------------- 1 | ######### 2 | # Labels 3 | ######## 4 | module "label" { 5 | source = "../terraform-label" 6 | namespace = var.namespace 7 | name = var.name 8 | stage = var.stage 9 | delimiter = var.delimiter 10 | attributes = var.attributes 11 | tags = var.tags 12 | enabled = var.enabled 13 | } 14 | 15 | 16 | resource "aws_security_group" "internal" { 17 | 18 | name = var.security_group_name 19 | vpc_id = var.vpcID 20 | 21 | dynamic "ingress" { 22 | for_each = var.ServicePorts 23 | content { 24 | from_port = ingress.value 25 | to_port = ingress.value 26 | protocol = "tcp" 27 | cidr_blocks = [var.cidr] 28 | } 29 | } 30 | 31 | egress { 32 | from_port = 0 33 | to_port = 0 34 | protocol = "-1" 35 | cidr_blocks = ["0.0.0.0/0"] 36 | } 37 | 38 | tags = module.label.tags 39 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+windows/aws/modules/aws-sg-cidr-v2/output.tf: -------------------------------------------------------------------------------- 1 | output "aws_security_group_default" { 2 | value = aws_security_group.internal.id 3 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+windows/aws/modules/aws-sg-cidr/output.tf: -------------------------------------------------------------------------------- 1 | output "aws_security_group_default" { 2 | value = aws_security_group.default.id 3 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+windows/aws/modules/aws-sg-ref-v2/output.tf: -------------------------------------------------------------------------------- 1 | output "aws_security_group_default" { 2 | value = aws_security_group.default.id 3 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+windows/aws/modules/aws-sg-ref/output.tf: -------------------------------------------------------------------------------- 1 | output "aws_security_group_default" { 2 | value = aws_security_group.default.id 3 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+windows/aws/modules/aws-sg-requirement/output.tf: -------------------------------------------------------------------------------- 1 | output "aws_security_group" { 2 | value = aws_security_group.security_group.id 3 | } 4 | -------------------------------------------------------------------------------- /terraform.v12/vpc+windows/aws/modules/eip/wordpress/main.tf: -------------------------------------------------------------------------------- 1 | resource "aws_eip" "default" { 2 | vpc = var.vpc 3 | instance = var.instance 4 | network_interface = var.network_interface 5 | associate_with_private_ip = var.associate_with_private_ip 6 | public_ipv4_pool = var.public_ipv4_pool 7 | 8 | tags = merge(var.tags, { "Name" = var.name }) 9 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+windows/aws/modules/eip/wordpress/output.tf: -------------------------------------------------------------------------------- 1 | output "id" { 2 | description = "Contains the EIP allocation ID" 3 | value = aws_eip.default.id 4 | } 5 | 6 | output "public_ip" { 7 | description = "Contains the public IP address" 8 | value = aws_eip.default.public_ip 9 | } 10 | 11 | output "public_dns" { 12 | description = "Public DNS associated with the Elastic IP address" 13 | value = aws_eip.default.public_dns 14 | } 15 | -------------------------------------------------------------------------------- /terraform.v12/vpc+windows/aws/modules/secrets/windows.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDYSR8gXjA2YjqVjf7KP6T8ywZ/PSZx8RxCW73Qc05Ye5SWW/0e8JjLTuUH5fI2BdSrHpY7ISzno2zaW0A7gQ9f4H2MX9bRubizcIujqfFGDhWxbcJrPsHW9aS8lbSDDD4MpDKtUknv9iJhWxT4G+di4kv/NpqqDkSJFSCvT2KhJLBAF68qsL0P23KYK/qbgun/ykthECYO9FR7AKhVFvAHlHsKJ9sKwzEDJsMGXzMJBGJSyyojVmablKBVJA3DCoaqqOJzPxeOnFykCLdZAf/rcUUrqMREtkYiQEGtBGE9C4tA/OubJsUuzDvIgpwuUx/Cx5yNrQCqToCqgsYsQA1d2gbOlO0BFj4O5/lzz/zpH7Ux+UpxVepMZxn/Fk8lKKhOQoQEfL6la4Ox6Nsq5Puz4bwvq3lwYOANkAVk7eipW7C7VlHUwJ+H0gssp6ya1DqYRf0hSlcqwSpgWZhMupAoUgQWqLzIHGWh5o0lA4lKx7vU/EK9wHLY22RSIQS3Cvs= Muhammad Asim@DESKTOP-3MFKCUC 2 | -------------------------------------------------------------------------------- /terraform.v12/vpc+windows/aws/modules/terraform-label/main.tf: -------------------------------------------------------------------------------- 1 | locals { 2 | original_tags = join(var.delimiter, compact(concat(list(var.namespace, var.stage, var.name), var.attributes))) 3 | transformed_tags = var.convert_case ? lower(local.original_tags) : local.original_tags 4 | } 5 | 6 | locals { 7 | id = var.enabled ? local.transformed_tags : "" 8 | 9 | name = var.enabled ? (var.convert_case ? lower(format("%v", var.name)) : format("%v", var.name)) : "" 10 | namespace = var.enabled ? (var.convert_case ? lower(format("%v", var.namespace)) : format("%v", var.namespace)) : "" 11 | stage = var.enabled ? (var.convert_case ? lower(format("%v", var.stage)) : format("%v", var.stage)) : "" 12 | delimiter = var.enabled ? (var.convert_case ? lower(format("%v", var.delimiter)) : format("%v", var.delimiter)) : "" 13 | attributes = var.enabled ? (var.convert_case ? lower(format("%v", join(var.delimiter, compact(var.attributes)))) : format("%v", join(var.delimiter, compact(var.attributes)))) : "" 14 | 15 | tags = merge( 16 | { 17 | "Name" = local.id 18 | "Namespace" = local.namespace 19 | "Stage" = local.stage 20 | }, 21 | var.tags 22 | ) 23 | } 24 | -------------------------------------------------------------------------------- /terraform.v12/vpc+windows/aws/modules/terraform-label/outputs.tf: -------------------------------------------------------------------------------- 1 | output "id" { 2 | value = local.id 3 | description = "Disambiguated ID" 4 | } 5 | 6 | output "name" { 7 | value = local.name 8 | description = "Normalized name" 9 | } 10 | 11 | output "namespace" { 12 | value = local.namespace 13 | description = "Normalized namespace" 14 | } 15 | 16 | output "stage" { 17 | value = local.stage 18 | description = "Normalized stage" 19 | } 20 | 21 | output "delimiter" { 22 | value = local.delimiter 23 | description = "Delimiter between `namespace`, `stage`, `name` and `attributes`" 24 | } 25 | 26 | output "attributes" { 27 | value = local.attributes 28 | description = "Normalized attributes" 29 | } 30 | 31 | output "tags" { 32 | value = local.tags 33 | description = "Normalized Tag map" 34 | } 35 | -------------------------------------------------------------------------------- /terraform.v12/vpc+wordpress-ec2/aws/environment/dev/plugin/all-in-one-wp-migration-file-extension.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quickbooks2018/Terraform-V-12/1232e64251afc07495e9cc03d01bed3cf8d46050/terraform.v12/vpc+wordpress-ec2/aws/environment/dev/plugin/all-in-one-wp-migration-file-extension.zip -------------------------------------------------------------------------------- /terraform.v12/vpc+wordpress-ec2/aws/environment/dev/plugin/all-in-one-wp-migration-file-extension/changelog.txt: -------------------------------------------------------------------------------- 1 | = 1.0.0 = 2 | * Import from file up to 512MB 3 | -------------------------------------------------------------------------------- /terraform.v12/vpc+wordpress-ec2/aws/environment/dev/plugin/all-in-one-wp-migration-file-extension/readme.txt: -------------------------------------------------------------------------------- 1 | Install instructions: https://help.servmask.com/knowledgebase/install-instructions-for-file-extension/ 2 | User guide: https://help.servmask.com/knowledgebase/file-extension-user-guide/ 3 | -------------------------------------------------------------------------------- /terraform.v12/vpc+wordpress-ec2/aws/environment/dev/variables.tf: -------------------------------------------------------------------------------- 1 | #variable "rds-secret" { type = string } 2 | -------------------------------------------------------------------------------- /terraform.v12/vpc+wordpress-ec2/aws/environment/dev/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_version = "~> 0.12.0" 3 | } 4 | -------------------------------------------------------------------------------- /terraform.v12/vpc+wordpress-ec2/aws/modules/aws-ec2-keypair/main.tf: -------------------------------------------------------------------------------- 1 | 2 | ######### 3 | # Labels 4 | ######## 5 | module "label" { 6 | source = "../terraform-label" 7 | namespace = var.namespace 8 | name = var.name 9 | stage = var.stage 10 | delimiter = var.delimiter 11 | attributes = var.attributes 12 | tags = var.tags 13 | enabled = var.enabled 14 | } 15 | 16 | resource "aws_key_pair" "keypair" { 17 | key_name = var.key-name 18 | public_key = var.public-key 19 | } 20 | -------------------------------------------------------------------------------- /terraform.v12/vpc+wordpress-ec2/aws/modules/aws-ec2-keypair/output.tf: -------------------------------------------------------------------------------- 1 | #OUTPUT EC2 KEYPAIR 2 | output "key-pair" { 3 | value = aws_key_pair.keypair.id 4 | } 5 | 6 | output "key-name" { 7 | value = aws_key_pair.keypair.key_name 8 | } 9 | 10 | output "public-key" { 11 | value = aws_key_pair.keypair.public_key 12 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+wordpress-ec2/aws/modules/aws-sg-cidr-v2/maint.tf: -------------------------------------------------------------------------------- 1 | ######### 2 | # Labels 3 | ######## 4 | module "label" { 5 | source = "../terraform-label" 6 | namespace = var.namespace 7 | name = var.name 8 | stage = var.stage 9 | delimiter = var.delimiter 10 | attributes = var.attributes 11 | tags = var.tags 12 | enabled = var.enabled 13 | } 14 | 15 | 16 | resource "aws_security_group" "internal" { 17 | 18 | name = var.security_group_name 19 | vpc_id = var.vpcID 20 | 21 | dynamic "ingress" { 22 | for_each = var.ServicePorts 23 | content { 24 | from_port = ingress.value 25 | to_port = ingress.value 26 | protocol = "tcp" 27 | cidr_blocks = [var.cidr] 28 | } 29 | } 30 | 31 | egress { 32 | from_port = 0 33 | to_port = 0 34 | protocol = "-1" 35 | cidr_blocks = ["0.0.0.0/0"] 36 | } 37 | 38 | tags = module.label.tags 39 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+wordpress-ec2/aws/modules/aws-sg-cidr-v2/output.tf: -------------------------------------------------------------------------------- 1 | output "aws_security_group_default" { 2 | value = aws_security_group.internal.id 3 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+wordpress-ec2/aws/modules/aws-sg-cidr/output.tf: -------------------------------------------------------------------------------- 1 | output "aws_security_group_default" { 2 | value = aws_security_group.default.id 3 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+wordpress-ec2/aws/modules/aws-sg-ref-v2/output.tf: -------------------------------------------------------------------------------- 1 | output "aws_security_group_default" { 2 | value = aws_security_group.default.id 3 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+wordpress-ec2/aws/modules/aws-sg-ref/output.tf: -------------------------------------------------------------------------------- 1 | output "aws_security_group_default" { 2 | value = aws_security_group.default.id 3 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+wordpress-ec2/aws/modules/aws-sg-requirement/output.tf: -------------------------------------------------------------------------------- 1 | output "aws_security_group" { 2 | value = aws_security_group.security_group.id 3 | } 4 | -------------------------------------------------------------------------------- /terraform.v12/vpc+wordpress-ec2/aws/modules/eip/wordpress/main.tf: -------------------------------------------------------------------------------- 1 | resource "aws_eip" "default" { 2 | vpc = var.vpc 3 | instance = var.instance 4 | network_interface = var.network_interface 5 | associate_with_private_ip = var.associate_with_private_ip 6 | public_ipv4_pool = var.public_ipv4_pool 7 | 8 | tags = merge(var.tags, { "Name" = var.name }) 9 | } -------------------------------------------------------------------------------- /terraform.v12/vpc+wordpress-ec2/aws/modules/eip/wordpress/output.tf: -------------------------------------------------------------------------------- 1 | output "id" { 2 | description = "Contains the EIP allocation ID" 3 | value = aws_eip.default.id 4 | } 5 | 6 | output "public_ip" { 7 | description = "Contains the public IP address" 8 | value = aws_eip.default.public_ip 9 | } 10 | 11 | output "public_dns" { 12 | description = "Public DNS associated with the Elastic IP address" 13 | value = aws_eip.default.public_dns 14 | } 15 | -------------------------------------------------------------------------------- /terraform.v12/vpc+wordpress-ec2/aws/modules/secrets/wordpress.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDHVRw4KTo3xB4PvpcBMDLJPyT1vcyA4XKI66hiCbfWamTcuqpKrHs9ks81PvzfuPCyebnW8Rm2Vj6QUQWia4tMuZKSTRMV4JYsagZe+p4c8Zu8kqDtmfTUQoYd9Kx/PCfy4SXbIjitAneCNjLBy5Z2scSkbm2fGqI7qi2+FYGQmdJI9aIUiDdSHihzHJUfWDbHXtt4rAo4UAtjXMcBKqwQnUjCzN3EUfXB56wvoIcGKMgqNDwa6r4hCVcuXlQTaA+GHvlMITOeuJXiZN56znOnaz+CERm9/3vIZy2mbCohnvqwNbHP1/qduVOUX7gxrZMCnzkGD372GnMp6rUyxL4p6ObF0yUw2Ic57naFzrbfmnSXtui02PNTMEH+UiOtbOWJ3JqzFthwxQl9Mmpya/ygu8vqxq1iHYgZdxGEs+hmTY4u2VDX3DDW+NfLZeHQxLWkLr+eOcHb3XDPYFzPhll7K3vFXSuzpsk1bgqanpFtxoF2DW2LGAP8sFlqPBoy64U= Muhammad Asim@DESKTOP-N7P5RL0 2 | -------------------------------------------------------------------------------- /terraform.v12/vpc+wordpress-ec2/aws/modules/terraform-label/outputs.tf: -------------------------------------------------------------------------------- 1 | output "id" { 2 | value = local.id 3 | description = "Disambiguated ID" 4 | } 5 | 6 | output "name" { 7 | value = local.name 8 | description = "Normalized name" 9 | } 10 | 11 | output "namespace" { 12 | value = local.namespace 13 | description = "Normalized namespace" 14 | } 15 | 16 | output "stage" { 17 | value = local.stage 18 | description = "Normalized stage" 19 | } 20 | 21 | output "delimiter" { 22 | value = local.delimiter 23 | description = "Delimiter between `namespace`, `stage`, `name` and `attributes`" 24 | } 25 | 26 | output "attributes" { 27 | value = local.attributes 28 | description = "Normalized attributes" 29 | } 30 | 31 | output "tags" { 32 | value = local.tags 33 | description = "Normalized Tag map" 34 | } 35 | -------------------------------------------------------------------------------- /terraform.v12/vpc-ansible-ec2-controller-+-managed-nodes/aws/environment/dev/ec2-console.tf: -------------------------------------------------------------------------------- 1 | resource "aws_iam_instance_profile" "aws-iam-instance-profile" { 2 | name = "aws-iam-instance-profile" 3 | role = aws_iam_role.ec2-role.name 4 | } 5 | 6 | resource "aws_iam_role" "ec2-role" { 7 | name = "ec2-rabbitmq-cluster-role" 8 | path = "/" 9 | 10 | assume_role_policy = < 3 | # Update route53 record 4 | localip=$(curl -fs http://169.254.169.254/latest/meta-data/local-ipv4) 5 | hostedzoneid="kkkallskshhgAAbbshhAA" 6 | file=/tmp/record.json 7 | cat << EOF > $file 8 | { 9 | "Comment": "Update the A record set", 10 | "Changes": [ 11 | { 12 | "Action": "UPSERT", 13 | "ResourceRecordSet": { 14 | "Name": "eureka-server.cloudgeeks.ca.local", 15 | "Type": "A", 16 | "TTL": 10, 17 | "ResourceRecords": [ 18 | { 19 | "Value": "$localip" 20 | } 21 | ] 22 | } 23 | } 24 | ] 25 | } 26 | EOF 27 | 28 | aws route53 change-resource-record-sets --hosted-zone-id $hostedzoneid --change-batch file://$file 29 | 30 | #END 31 | -------------------------------------------------------------------------------- /terraform.v12/vpc-netflix-eureka-server/aws/environment/dev/variables.tf: -------------------------------------------------------------------------------- 1 | #variable "rds-secret" { type = string } 2 | -------------------------------------------------------------------------------- /terraform.v12/vpc-netflix-eureka-server/aws/environment/dev/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_version = "~> 0.12.0" 3 | } 4 | -------------------------------------------------------------------------------- /terraform.v12/vpc-netflix-eureka-server/aws/modules/aws-ec2-keypair/main.tf: -------------------------------------------------------------------------------- 1 | #Creating EC2-Key Pair 2 | provider "aws" { 3 | region = var.region 4 | } 5 | 6 | ######### 7 | # Labels 8 | ######## 9 | module "label" { 10 | source = "../terraform-label" 11 | namespace = var.namespace 12 | name = var.name 13 | stage = var.stage 14 | delimiter = var.delimiter 15 | attributes = var.attributes 16 | tags = var.tags 17 | enabled = var.enabled 18 | } 19 | 20 | resource "aws_key_pair" "keypair" { 21 | key_name = var.key-name 22 | public_key = var.public-key 23 | } 24 | -------------------------------------------------------------------------------- /terraform.v12/vpc-netflix-eureka-server/aws/modules/aws-ec2-keypair/output.tf: -------------------------------------------------------------------------------- 1 | #OUTPUT EC2 KEYPAIR 2 | output "key-pair" { 3 | value = aws_key_pair.keypair.id 4 | } 5 | 6 | output "key-name" { 7 | value = aws_key_pair.keypair.key_name 8 | } 9 | 10 | output "public-key" { 11 | value = aws_key_pair.keypair.public_key 12 | } -------------------------------------------------------------------------------- /terraform.v12/vpc-netflix-eureka-server/aws/modules/aws-ec2-keypair/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_version = "~> 0.12.0" 3 | } 4 | -------------------------------------------------------------------------------- /terraform.v12/vpc-netflix-eureka-server/aws/modules/aws-ec2/user-data/user-data.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Docker installation 4 | 5 | yum install -y docker 6 | 7 | systemctl start docker 8 | 9 | systemctl enable docker 10 | 11 | 12 | #END 13 | -------------------------------------------------------------------------------- /terraform.v12/vpc-netflix-eureka-server/aws/modules/aws-sg-cidr-v2/maint.tf: -------------------------------------------------------------------------------- 1 | ######### 2 | # Labels 3 | ######## 4 | module "label" { 5 | source = "../terraform-label" 6 | namespace = var.namespace 7 | name = var.name 8 | stage = var.stage 9 | delimiter = var.delimiter 10 | attributes = var.attributes 11 | tags = var.tags 12 | enabled = var.enabled 13 | } 14 | 15 | 16 | resource "aws_security_group" "internal" { 17 | 18 | name = var.security_group_name 19 | vpc_id = var.vpcID 20 | 21 | dynamic "ingress" { 22 | for_each = var.ServicePorts 23 | content { 24 | from_port = ingress.value 25 | to_port = ingress.value 26 | protocol = "tcp" 27 | cidr_blocks = [var.cidr] 28 | } 29 | } 30 | 31 | egress { 32 | from_port = 0 33 | to_port = 0 34 | protocol = "-1" 35 | cidr_blocks = ["0.0.0.0/0"] 36 | } 37 | 38 | tags = module.label.tags 39 | } -------------------------------------------------------------------------------- /terraform.v12/vpc-netflix-eureka-server/aws/modules/aws-sg-cidr-v2/output.tf: -------------------------------------------------------------------------------- 1 | output "aws_security_group_default" { 2 | value = aws_security_group.internal.id 3 | } -------------------------------------------------------------------------------- /terraform.v12/vpc-netflix-eureka-server/aws/modules/aws-sg-cidr/output.tf: -------------------------------------------------------------------------------- 1 | output "aws_security_group_default" { 2 | value = aws_security_group.default.id 3 | } -------------------------------------------------------------------------------- /terraform.v12/vpc-netflix-eureka-server/aws/modules/aws-sg-ref-v2/output.tf: -------------------------------------------------------------------------------- 1 | output "aws_security_group_default" { 2 | value = aws_security_group.default.id 3 | } -------------------------------------------------------------------------------- /terraform.v12/vpc-netflix-eureka-server/aws/modules/aws-sg-ref/output.tf: -------------------------------------------------------------------------------- 1 | output "aws_security_group_default" { 2 | value = aws_security_group.default.id 3 | } -------------------------------------------------------------------------------- /terraform.v12/vpc-netflix-eureka-server/aws/modules/aws-sg-requirement/output.tf: -------------------------------------------------------------------------------- 1 | output "aws_security_group" { 2 | value = aws_security_group.security_group.id 3 | } 4 | -------------------------------------------------------------------------------- /terraform.v12/vpc-netflix-eureka-server/aws/modules/eip/eureka-server/main.tf: -------------------------------------------------------------------------------- 1 | resource "aws_eip" "default" { 2 | vpc = var.vpc 3 | instance = var.instance 4 | network_interface = var.network_interface 5 | associate_with_private_ip = var.associate_with_private_ip 6 | public_ipv4_pool = var.public_ipv4_pool 7 | 8 | tags = merge(var.tags, { "Name" = var.name }) 9 | } -------------------------------------------------------------------------------- /terraform.v12/vpc-netflix-eureka-server/aws/modules/eip/eureka-server/output.tf: -------------------------------------------------------------------------------- 1 | output "id" { 2 | description = "Contains the EIP allocation ID" 3 | value = aws_eip.default.id 4 | } 5 | 6 | output "public_ip" { 7 | description = "Contains the public IP address" 8 | value = aws_eip.default.public_ip 9 | } 10 | 11 | output "public_dns" { 12 | description = "Public DNS associated with the Elastic IP address" 13 | value = aws_eip.default.public_dns 14 | } 15 | -------------------------------------------------------------------------------- /terraform.v12/vpc-netflix-eureka-server/aws/modules/secrets/eureka-server.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC9uodpJHsrWWw4TtHpB6qcUTsi11QMTWaZg53vJF4E39OZ9Su+ZCREN9WYUdPH5nZBPEjZWM04VdgMPogqdYpI91zfiHTAERzmp7hbQubtN1gSOcvGmpZ9cDOV8Ogv+15i0mB0VmBIn301zrmaXtlSuXxxw/tzm8IQNg56ww6ti/RzVsP4Qj+AnIeJvrLydOu4gc6RF/TD8vL9yxkvpXNLPw4Yu65hjI0je5C4h6N1zouxpue4odnNjY/juLqsGZHFKy2KxtYkeUiuLOD5cc3JpEQ4taKpIOqPoLdc6ylLaP7wLVs+cGTr5rLwizDrTJw5l7oxtXkUEnlCKCO4bsu6DfbG+8Pdl+eM6IxNnyDd2sUpF1A8uV6rfayMk59oZdisHYQpsc2x4jrCvmvO4j6V+AjLxiCyrwyzMeVUrDdNOU9oALG9o5YpBT7MyPep01Md+BB+5sUewnTB1HNKWeZBXAdzVgBXK6snuPGc6VAeEObS/Wqz/35Ti6qlym5BpoE= Muhammad Asim@DESKTOP-96TI63M 2 | -------------------------------------------------------------------------------- /terraform.v12/vpc-netflix-eureka-server/aws/modules/secrets/eureka-service.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC2qwPHqsBButsNEBfK+2v0y++W5Zi+onqs68tlk0vbrNSvS9+4hmbj0U66PMaSuCC0qVj/1dNnh+oOcO47CY/BOboDNpcXBnAL4b4gdIqmyvC45KXRfDEmQsSsbT9XBQgZu7WQSS+vUfDYTRPBGW4aAsH0Q3C6mHsZsb/EhaictKBJJXVluR4YIKiz2n9Z/L5JHmGqkaXEfR8nwhk8XQ4rfwyBM7x4QVLA8JZV/m/7lYKNuRlBWl0iADqkxPYqCr+MpODb+63hik7aijLuHQXLt73UD2cj7R2EcR74SQQPpVtxuerwA4PJ0uFlA9qxIpIksPBm3fIYUZWA6Iq57FRQwZS52vCFF0MTSHEeuFlB+u4zpAirghgtA2eDSwdVCErVOgTAHkC2ihNkcu/K5D9gchCJ7uBnZMOEXlmuJld5cuk4MyL4JAb7DlgV/5CYftsdq94s7Ydk3zprOl3UTL+6xrOyThfVzDRt5VLo0M3Si/gdEA6kpAJ9vrFeqrkuXTM= Muhammad Asim@DESKTOP-96TI63M 2 | -------------------------------------------------------------------------------- /terraform.v12/vpc-netflix-eureka-server/aws/modules/terraform-label/outputs.tf: -------------------------------------------------------------------------------- 1 | output "id" { 2 | value = local.id 3 | description = "Disambiguated ID" 4 | } 5 | 6 | output "name" { 7 | value = local.name 8 | description = "Normalized name" 9 | } 10 | 11 | output "namespace" { 12 | value = local.namespace 13 | description = "Normalized namespace" 14 | } 15 | 16 | output "stage" { 17 | value = local.stage 18 | description = "Normalized stage" 19 | } 20 | 21 | output "delimiter" { 22 | value = local.delimiter 23 | description = "Delimiter between `namespace`, `stage`, `name` and `attributes`" 24 | } 25 | 26 | output "attributes" { 27 | value = local.attributes 28 | description = "Normalized attributes" 29 | } 30 | 31 | output "tags" { 32 | value = local.tags 33 | description = "Normalized Tag map" 34 | } 35 | -------------------------------------------------------------------------------- /terraform.v12/vpc/environment/dev/main.tf: -------------------------------------------------------------------------------- 1 | provider "aws" { 2 | region = "us-east-1" 3 | } 4 | 5 | ##### 6 | # Vpc 7 | ##### 8 | 9 | module "vpc" { 10 | source = "../../modules/aws-vpc" 11 | 12 | vpc-location = "Virginia" 13 | namespace = "cloudgeeks.ca" 14 | name = "vpc" 15 | stage = "dev" 16 | map_public_ip_on_launch = "true" 17 | total-nat-gateway-required = "1" 18 | create_database_subnet_group = "false" 19 | vpc-cidr = "10.11.0.0/16" 20 | vpc-public-subnet-cidr = ["10.11.1.0/24","10.11.2.0/24"] 21 | vpc-private-subnet-cidr = ["10.11.4.0/24","10.11.5.0/24"] 22 | vpc-database_subnets-cidr = ["10.11.7.0/24", "10.11.8.0/24"] 23 | } 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /terraform.v12/vpc/environment/dev/variables.tf: -------------------------------------------------------------------------------- 1 | #variable "rds-secret" { type = string } 2 | -------------------------------------------------------------------------------- /terraform.v12/vpc/environment/dev/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_version = "~> 0.12.0" 3 | } 4 | -------------------------------------------------------------------------------- /terraform.v12/vpc/modules/terraform-label/main.tf: -------------------------------------------------------------------------------- 1 | locals { 2 | original_tags = join(var.delimiter, compact(concat(list(var.namespace, var.stage, var.name), var.attributes))) 3 | transformed_tags = var.convert_case ? lower(local.original_tags) : local.original_tags 4 | } 5 | 6 | locals { 7 | id = var.enabled ? local.transformed_tags : "" 8 | 9 | name = var.enabled ? (var.convert_case ? lower(format("%v", var.name)) : format("%v", var.name)) : "" 10 | namespace = var.enabled ? (var.convert_case ? lower(format("%v", var.namespace)) : format("%v", var.namespace)) : "" 11 | stage = var.enabled ? (var.convert_case ? lower(format("%v", var.stage)) : format("%v", var.stage)) : "" 12 | delimiter = var.enabled ? (var.convert_case ? lower(format("%v", var.delimiter)) : format("%v", var.delimiter)) : "" 13 | attributes = var.enabled ? (var.convert_case ? lower(format("%v", join(var.delimiter, compact(var.attributes)))) : format("%v", join(var.delimiter, compact(var.attributes)))) : "" 14 | 15 | tags = merge( 16 | { 17 | "Name" = local.id 18 | "Namespace" = local.namespace 19 | "Stage" = local.stage 20 | }, 21 | var.tags 22 | ) 23 | } 24 | -------------------------------------------------------------------------------- /terraform.v12/vpc/modules/terraform-label/outputs.tf: -------------------------------------------------------------------------------- 1 | output "id" { 2 | value = local.id 3 | description = "Disambiguated ID" 4 | } 5 | 6 | output "name" { 7 | value = local.name 8 | description = "Normalized name" 9 | } 10 | 11 | output "namespace" { 12 | value = local.namespace 13 | description = "Normalized namespace" 14 | } 15 | 16 | output "stage" { 17 | value = local.stage 18 | description = "Normalized stage" 19 | } 20 | 21 | output "delimiter" { 22 | value = local.delimiter 23 | description = "Delimiter between `namespace`, `stage`, `name` and `attributes`" 24 | } 25 | 26 | output "attributes" { 27 | value = local.attributes 28 | description = "Normalized attributes" 29 | } 30 | 31 | output "tags" { 32 | value = local.tags 33 | description = "Normalized Tag map" 34 | } 35 | --------------------------------------------------------------------------------