-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
391a8fb
commit 04016d7
Showing
19 changed files
with
335 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,34 @@ | ||
.idea/ | ||
*.iml | ||
*.iws | ||
.target/ | ||
target/ | ||
.sonar/ | ||
.sonarlint/ | ||
|
||
.github/ | ||
.gradle/ | ||
.build/ | ||
build/ | ||
fluentbit/ | ||
grafana/ | ||
infra/ | ||
k8s/ | ||
log/ | ||
logs/ | ||
prometheus/ | ||
scripts/ | ||
sonarqube/ | ||
telegraf/ | ||
|
||
.github/ | ||
|
||
log/ | ||
logs/ | ||
CHANGELOG.md | ||
CODEOWNERS.md | ||
compose.yaml | ||
CONTRIBUTING.md | ||
HELP.md | ||
Jenkinsfile | ||
LICENSE | ||
Makefile | ||
README.md | ||
sonar-compose.yaml | ||
template-service-java-springboot.postman_collection.json |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,3 +40,9 @@ out/ | |
## logs | ||
log/ | ||
logs/ | ||
|
||
# terraform | ||
*.tfstate | ||
**/*.tfstate | ||
.terraform/ | ||
**/.terraform/ |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Empty file.
Empty file.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module "project_aws_s3_buckets" { | ||
source = "./modules/aws/s3/buckets" | ||
} | ||
|
||
#module "project_aws_cloudfront_distribution" { | ||
# source = "./modules/aws/cloudfront/distribution" | ||
#} |
100 changes: 100 additions & 0 deletions
100
infra/modules/aws/cloudfront/distribution/documentssstore.tf
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
#resource "aws_cloudfront_distribution" "s3_distribution" { | ||
# origin { | ||
# domain_name = aws_s3_bucket.b.bucket_regional_domain_name | ||
# origin_access_control_id = aws_cloudfront_origin_access_control.default.id | ||
# origin_id = local.s3_origin_id | ||
# } | ||
# | ||
# enabled = true | ||
# is_ipv6_enabled = true | ||
# comment = "Some comment" | ||
# | ||
# logging_config { | ||
# include_cookies = false | ||
# bucket = "mylogs.s3.amazonaws.com" | ||
# prefix = "myprefix" | ||
# } | ||
# | ||
# aliases = ["mysite.example.com", "yoursite.example.com"] | ||
# | ||
# default_cache_behavior { | ||
# allowed_methods = ["DELETE", "GET", "HEAD", "OPTIONS", "PATCH", "POST", "PUT"] | ||
# cached_methods = ["GET", "HEAD"] | ||
# target_origin_id = local.s3_origin_id | ||
# | ||
# forwarded_values { | ||
# query_string = false | ||
# | ||
# cookies { | ||
# forward = "none" | ||
# } | ||
# } | ||
# | ||
# viewer_protocol_policy = "allow-all" | ||
# min_ttl = 0 | ||
# default_ttl = 3600 | ||
# max_ttl = 86400 | ||
# } | ||
# | ||
# # Cache behavior with precedence 0 | ||
# ordered_cache_behavior { | ||
# path_pattern = "/content/immutable/*" | ||
# allowed_methods = ["GET", "HEAD", "OPTIONS"] | ||
# cached_methods = ["GET", "HEAD", "OPTIONS"] | ||
# target_origin_id = local.s3_origin_id | ||
# | ||
# forwarded_values { | ||
# query_string = false | ||
# headers = ["Origin"] | ||
# | ||
# cookies { | ||
# forward = "none" | ||
# } | ||
# } | ||
# | ||
# min_ttl = 0 | ||
# default_ttl = 86400 | ||
# max_ttl = 31536000 | ||
# compress = true | ||
# viewer_protocol_policy = "redirect-to-https" | ||
# } | ||
# | ||
# # Cache behavior with precedence 1 | ||
# ordered_cache_behavior { | ||
# path_pattern = "/content/*" | ||
# allowed_methods = ["GET", "HEAD", "OPTIONS"] | ||
# cached_methods = ["GET", "HEAD"] | ||
# target_origin_id = local.s3_origin_id | ||
# | ||
# forwarded_values { | ||
# query_string = false | ||
# | ||
# cookies { | ||
# forward = "none" | ||
# } | ||
# } | ||
# | ||
# min_ttl = 0 | ||
# default_ttl = 3600 | ||
# max_ttl = 86400 | ||
# compress = true | ||
# viewer_protocol_policy = "redirect-to-https" | ||
# } | ||
# | ||
# price_class = "PriceClass_200" | ||
# | ||
# restrictions { | ||
# geo_restriction { | ||
# restriction_type = "whitelist" | ||
# locations = ["US", "CA", "GB", "DE"] | ||
# } | ||
# } | ||
# | ||
# tags = { | ||
# Environment = "${var.environment}" | ||
# } | ||
# | ||
# viewer_certificate { | ||
# cloudfront_default_certificate = true | ||
# } | ||
#} |
Empty file.
Empty file.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
variable "region" { | ||
type = string | ||
description = "AWS region for all resources." | ||
|
||
default = "ap-south-1" | ||
} | ||
|
||
variable "project_name" { | ||
type = string | ||
description = "Template service in java, spring-boot project." | ||
|
||
default = "template-service-java-spring-boot" | ||
} | ||
|
||
variable "environment" { | ||
type = string | ||
description = "Template service in java, spring-boot project." | ||
|
||
default = "test" | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
resource "aws_s3_bucket" "documentssstore" { | ||
bucket = "documentssstore" | ||
|
||
tags = { | ||
Name = "documentssstore" | ||
Owner = "${var.project_name}" | ||
Environment = "${var.environment}" | ||
Region = "${var.region}" | ||
} | ||
} | ||
|
||
resource "aws_s3_bucket_policy" "documentssstore_allow_access_from_cloudfront" { | ||
bucket = aws_s3_bucket.documentssstore.id | ||
policy = data.aws_iam_policy_document.documentssstore_allow_access_from_cloudfront.json | ||
} | ||
|
||
data "aws_iam_policy_document" "documentssstore_allow_access_from_cloudfront" { | ||
statement { | ||
principals { | ||
type = "AWS" | ||
identifiers = ["cloudfront.amazonaws.com"] | ||
} | ||
|
||
actions = [ | ||
"s3:GetObject", | ||
] | ||
|
||
resources = [ | ||
aws_s3_bucket.documentssstore.arn, | ||
"${aws_s3_bucket.documentssstore.arn}/*", | ||
] | ||
|
||
condition { | ||
test = "StringEquals" | ||
values = ["arn:aws:cloudfront::430689894701:distribution/E2ZI5IWQWTVER"] | ||
variable = "AWS:SourceArn" | ||
} | ||
} | ||
} |
Empty file.
Empty file.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
variable "region" { | ||
type = string | ||
description = "AWS region for all resources." | ||
|
||
default = "ap-south-1" | ||
} | ||
|
||
variable "project_name" { | ||
type = string | ||
description = "Template service in java, spring-boot project." | ||
|
||
default = "template-service-java-spring-boot" | ||
} | ||
|
||
variable "environment" { | ||
type = string | ||
description = "Template service in java, spring-boot project." | ||
|
||
default = "test" | ||
} |
Empty file.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
provider "aws" { | ||
region = var.region | ||
} | ||
|
||
provider "random" {} | ||
|
||
provider "time" {} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Copyright (c) HashiCorp, Inc. | ||
# SPDX-License-Identifier: MPL-2.0 | ||
|
||
terraform { | ||
required_version = "~> 1.6" | ||
required_providers { | ||
aws = { | ||
source = "hashicorp/aws" | ||
version = "5.7.0" | ||
} | ||
random = { | ||
source = "hashicorp/random" | ||
version = "3.5.1" | ||
} | ||
time = { | ||
source = "hashicorp/time" | ||
version = "0.9.1" | ||
} | ||
} | ||
/* Uncomment this block to use Terraform Cloud for this tutorial | ||
cloud { | ||
organization = "organization-name" | ||
workspaces { | ||
name = "learn-terraform-apply" | ||
} | ||
} | ||
*/ | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
variable "region" { | ||
type = string | ||
description = "AWS region for all resources." | ||
|
||
default = "ap-south-1" | ||
} | ||
|
||
variable "project_name" { | ||
type = string | ||
description = "Template service in java, spring-boot project." | ||
|
||
default = "template-service-java-spring-boot" | ||
} | ||
|
||
variable "environment" { | ||
type = string | ||
description = "Template service in java, spring-boot project." | ||
|
||
default = "test" | ||
} |
This file contains 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