This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # ================================================ | |
| # Multi-Domain Nginx SSL Management | |
| # ================================================ | |
| # Manage multiple domains with different configurations | |
| # ================================================ | |
| set -e |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Ensure script is run as root | |
| if [ "$EUID" -ne 0 ]; then | |
| echo "❌ Please run this script as root (use sudo)." | |
| exit 1 | |
| fi | |
| export DEBIAN_FRONTEND=noninteractive |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| data "aws_availability_zones" "available" { | |
| state = "available" | |
| } | |
| resource "aws_vpc" "aws_vpc" { | |
| cidr_block = var.vpc_cidr_block | |
| enable_dns_hostnames = true | |
| tags = { | |
| Name = "aws_vpc" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| resource "aws_iam_role" "inspector_event_role" { | |
| name = "inspector-event-role-${var.random_id_prefix}" | |
| assume_role_policy = <<EOF | |
| { | |
| "Version": "2012-10-17", | |
| "Statement": [ | |
| { | |
| "Action": "sts:AssumeRole", | |
| "Principal": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| resource "aws_cloudwatch_event_rule" "inspector_event_schedule" { | |
| name = "inspector-schedule-cloudwatch-event-rule${var.random_id_prefix}" | |
| description = "Trigger an Inspector Assessment" | |
| schedule_expression = var.schedule_expression | |
| } | |
| resource "aws_cloudwatch_event_target" "inspector_event_target" { | |
| rule = aws_cloudwatch_event_rule.inspector_event_schedule.name | |
| arn = var.inspector_assessment_template_arn | |
| role_arn = var.inspector_event_role_arn |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| resource "aws_inspector_resource_group" "inspector_resource_group" { | |
| tags = { | |
| GroupName = "Production" | |
| <Tag Name> = "<Tag Value>" | |
| } | |
| } | |
| resource "aws_inspector_assessment_target" "inspector_assessment_target" { | |
| name = "<Name of Your Assessment Target>" | |
| resource_group_arn = aws_inspector_resource_group.inspector_resource_group.arn |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: 0.2 | |
| env: | |
| variables: | |
| AWS_ACCESS_KEY_ID: "${AWS_ACCESS_KEY_ID}" | |
| AWS_SECRET_ACCESS_KEY: "${AWS_SECRET_ACCESS_KEY}" | |
| ASK_VENDOR_ID: "${ASK_VENDOR_ID}" | |
| ASK_REFRESH_TOKEN: "${ASK_REFRESH_TOKEN}" | |
| phases: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: 0.2 | |
| phases: | |
| install: | |
| commands: | |
| - npm install | |
| - npm install -g serverless | |
| build: | |
| commands: | |
| - serverless deploy --stage ${environment} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: 0.2 | |
| phases: | |
| install: | |
| runtime-versions: | |
| android: 29 | |
| java: openjdk8 | |
| commands: | |
| - pwd | |
| pre_build: | |
| commands: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /*==== The VPC ======*/ | |
| resource "aws_vpc" "vpc" { | |
| cidr_block = "${var.vpc_cidr}" | |
| enable_dns_hostnames = true | |
| enable_dns_support = true | |
| tags = { | |
| Name = "${var.environment}-vpc" | |
| Environment = "${var.environment}" | |
| } | |
| } |
NewerOlder