Skip to content

Commit

Permalink
fix(DMVP-5087): fix cdn module docs and version constraint
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdntgrn committed Aug 27, 2024
1 parent eca02b6 commit 58393b1
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 27 deletions.
55 changes: 34 additions & 21 deletions modules/cloudfront-ssl-hsts/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Module to create aws cloudfront(CDN) resource with related resources and options.The var.origins is a list of origins with their behaviors, so that for each origin it creates the behavior also. The default behavior/origin is the last one from var.origins listing. For non default behaviors origin_object.behavior.path_pattern required, this defines the routing path for behavior.

# example with ALB default and 2 more cache behaviors:
## it creates
## example with s3 default and 1 more alb cache behaviors:

```hcl
provider "aws" {
Expand Down Expand Up @@ -38,31 +37,45 @@ module "cdn" {
type = "bucket"
}
]
providers = {
aws = aws
aws.virginia = aws.virginia
}
}
```

# sample with S3 default cache behavior
## sample with S3 default cache behavior

```hcl
provider "aws" {
region = "us-east-1"
region = "eu-central-1"
}
provider "aws" {
region = "us-east-1"
alias = "virginia"
}
module "cdn" {
source = "dasmeta/modules/aws//modules/cloudfront-ssl-hsts"
version = "2.16.0"
zone = ["devops.dasmeta.com"]
aliases = ["cdn.devops.dasmeta.com"]
comment = "My CloudFront"
origins = [
{
id = "s3"
type = "bucket"
domain_name = "the-s3-bucket-name" # you need to enable S3 website to have this
}
}
source = "dasmeta/modules/aws//modules/cloudfront-ssl-hsts"
version = "2.16.0"
zone = ["devops.dasmeta.com"]
aliases = ["cdn.devops.dasmeta.com"]
comment = "My CloudFront"
origins = [
{
id = "s3"
type = "bucket"
domain_name = "the-s3-bucket-name" # you need to enable S3 website to have this
}
}
providers = {
aws = aws
aws.virginia = aws.virginia
}
}
```

Expand All @@ -72,14 +85,14 @@ module "cdn" {
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.64 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.64, < 6.0 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.64 |
| <a name="provider_aws.virginia"></a> [aws.virginia](#provider\_aws.virginia) | >= 3.64 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.64, < 6.0 |
| <a name="provider_aws.virginia"></a> [aws.virginia](#provider\_aws.virginia) | >= 3.64, < 6.0 |

## Modules

Expand Down
2 changes: 1 addition & 1 deletion modules/cloudfront-ssl-hsts/tests/basic/0-setup.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 4.33"
version = "~> 5.0"
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions modules/cloudfront-ssl-hsts/tests/basic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@

| Name | Version |
|------|---------|
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | ~> 4.33 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | ~> 5.0 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | 4.67.0 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | 5.64.0 |

## Modules

Expand Down
2 changes: 1 addition & 1 deletion modules/cloudfront-ssl-hsts/tests/s3-and-alb/0-setup.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 4.33"
version = "~> 5.0"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion modules/cloudfront-ssl-hsts/tests/s3-and-alb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

| Name | Version |
|------|---------|
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | ~> 4.33 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | ~> 5.0 |

## Providers

Expand Down
2 changes: 1 addition & 1 deletion modules/cloudfront-ssl-hsts/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 3.64"
version = ">= 3.64, < 6.0"
configuration_aliases = [aws.virginia]
}
}
Expand Down

0 comments on commit 58393b1

Please sign in to comment.