Skip to content

Commit

Permalink
feat: support multiple origin (#15)
Browse files Browse the repository at this point in the history
* (add): new origin

* (fix): null resource

* (update): default value

* (update): code format

* (fix): output value

* (add): var origin_access_identities

* (fix): cloudfront output

* (update): origin to any type

* (update): outputs var name

* (add): cloudfront distribution arn as output

* (update): empty value from custom_header_token

* (update): set defautl value for origin_config

* (update): target_origin_id input

* (update): target_origin_id input

* (update): remove var.s3_origin

* (update): remove unused section

* (update): resource name

* (fix): EOL

* (add): origin group

* (update): remove secondary origin group

* (add): support name override

* (update): reformat code

* (update): code section

* (update): gitignore

* (push): move pc

* (update): cloudfront configuration

* (update): exmaple

* (update): example

* (update): CHANGELOG
  • Loading branch information
xshot9011 authored Dec 22, 2022
1 parent 55defee commit 76c2e81
Show file tree
Hide file tree
Showing 17 changed files with 697 additions and 477 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ crash.*.log
# to change depending on the environment.
#
*.tfvars
!examples/*/terraform.auto.tfvars

# Ignore override files as they are usually used to override resources locally and so
# are not checked in
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repos:
args:
- "--args=--only=terraform_deprecated_interpolation"
- "--args=--only=terraform_deprecated_index"
# - "--args=--only=terraform_unused_declarations"
- "--args=--only=terraform_unused_declarations"
- "--args=--only=terraform_comment_syntax"
- "--args=--only=terraform_documented_outputs"
- "--args=--only=terraform_documented_variables"
Expand Down
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,32 @@

All notable changes to this module will be documented in this file.

## [v1.1.0] - 2022-12-02

### Added

- Add `output.cloudfront_distribution_arn`
- Add variables `var.name_override`, `var.origin`, `var.origin_group` and `var.origin_access_identities`
- Add locals variables `local.empty_prefix`, `local.empty_environment`, `local.empty_name` and `local.raise_empty_name`
- Add attributes `dynamic "origin"` for all origin in `aws_cloudfront_distribution.distribution`

### Changed

- Update outputs
- Rename `output.cf_domain_name` to `output.cloudfront_distribution_domain_name`
- Rename `output.cf_s3_iam_arn` to `cloudfront_origin_access_identities`
- Update local `local.resource_name` to `local.name`
- Update variable description for `var.prefix`, `var.environment` and `var.name`
- Update resource `aws_cloudfront_distribution.distribution` code format
- Update attribute `default_cache_behavior`; `compress`, `min_ttl`, `default_ttl`, `max_ttl` in `aws_cloudfront_distribution.distribution`

### Removed

- Remove files `dns.tf`, `examples/complete/acm.tf`, `examples/complete/s3.tf`, `iam.tf` and `locals.tf`
- Remove variables `var.lambda_function_association`, `var.s3_origin`, `var.origin_read_timeout`, `var.custom_header_token`, `secondary_origin_config` and `var.origin_config`
- Remove resource `aws_cloudfront_origin_access_identity.cloudfront_s3_policy`
- Remove `custom_origin_config`, `dynamic "origin" (s3)`, `dynamic "ordered_cache_behavior" (s3)` attribute in `aws_cloudfront_distribution.distribution`

## [v1.0.7] - 2022-10-25

### Changed
Expand Down
187 changes: 27 additions & 160 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ Your can also report the vulnerabilities by emailing to Oozou DevOps team at:
devops@oozou.com
```

We will acknowledge your email within 72 hours on workday, and will send a more details response within 5 days. After the initial email start, we will investigate the security issue snd fix it as soon as possible.
We will acknowledge your email within 72 hours on workday, and will send a more details response within 5 days. After the initial email start, we will investigate the security issue snd fix it as soon as possible.
13 changes: 0 additions & 13 deletions dns.tf

This file was deleted.

36 changes: 24 additions & 12 deletions examples/complete/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,39 @@ No requirements.

## Providers

No providers.
| Name | Version |
|---------------------------------------------------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | 4.44.0 |

## Modules

| Name | Source | Version |
|------|--------|---------|
| <a name="module_acm_virginia"></a> [acm\_virginia](#module\_acm\_virginia) | git::ssh://git@github.com/oozou/terraform-aws-acm.git | v1.0.1 |
| <a name="module_cloudfront_distribution"></a> [cloudfront\_distribution](#module\_cloudfront\_distribution) | ../../ | n/a |
| <a name="module_s3_for_cloudfront_logs"></a> [s3\_for\_cloudfront\_logs](#module\_s3\_for\_cloudfront\_logs) | git@github.com:oozou/terraform-aws-s3.git | v1.0.4 |
| Name | Source | Version |
|--------------------------------------------------------------------------------------------------------------------|-------------------------------|---------|
| <a name="module_cloudfront_distribution"></a> [cloudfront\_distribution](#module\_cloudfront\_distribution) | ../../ | n/a |
| <a name="module_fargate_cluster"></a> [fargate\_cluster](#module\_fargate\_cluster) | oozou/ecs-fargate-cluster/aws | 1.0.6 |
| <a name="module_nginx_service"></a> [nginx\_service](#module\_nginx\_service) | oozou/ecs-fargate-service/aws | v1.1.9 |
| <a name="module_s3_bucket"></a> [s3\_bucket](#module\_s3\_bucket) | oozou/s3/aws | 1.1.3 |
| <a name="module_s3_cloudfront_log_bucket"></a> [s3\_cloudfront\_log\_bucket](#module\_s3\_cloudfront\_log\_bucket) | oozou/s3/aws | 1.1.3 |
| <a name="module_vpc"></a> [vpc](#module\_vpc) | oozou/vpc/aws | 1.2.4 |

## Resources

No resources.
| Name | Type |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------|
| [aws_cloudfront_origin_access_control.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudfront_origin_access_control) | resource |
| [aws_caller_identity.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) | data source |
| [aws_iam_policy_document.cloudfront_get_public_object_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |
| [aws_iam_policy_document.cloudfront_log_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |
| [aws_iam_policy_document.oac_access_kms_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_custom_tags"></a> [custom\_tags](#input\_custom\_tags) | Custom tags which can be passed on to the AWS resources. They should be key value pairs having distinct keys. | `map(string)` | `{}` | no |
| <a name="input_environment"></a> [environment](#input\_environment) | [Required] Name prefix used for resource naming in this component | `string` | n/a | yes |
| <a name="input_prefix"></a> [prefix](#input\_prefix) | [Required] Name prefix used for resource naming in this component | `string` | n/a | yes |
| Name | Description | Type | Default | Required |
|-----------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------|------------|---------|:--------:|
| <a name="input_custom_tags"></a> [custom\_tags](#input\_custom\_tags) | Custom tags which can be passed on to the AWS resources. They should be key value pairs having distinct keys | `map(any)` | `{}` | no |
| <a name="input_environment"></a> [environment](#input\_environment) | Environment Variable used as a prefix | `string` | n/a | yes |
| <a name="input_name"></a> [name](#input\_name) | Name of the resource or project | `string` | n/a | yes |
| <a name="input_prefix"></a> [prefix](#input\_prefix) | The prefix name of customer to be displayed in AWS console and resource | `string` | n/a | yes |

## Outputs

Expand Down
8 changes: 0 additions & 8 deletions examples/complete/acm.tf

This file was deleted.

Loading

0 comments on commit 76c2e81

Please sign in to comment.