Skip to content

Commit

Permalink
upgrade terraform, aws provider and provide example
Browse files Browse the repository at this point in the history
  • Loading branch information
jjcallis committed Mar 27, 2023
1 parent 1d40a79 commit 8e5600b
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 2 deletions.
5 changes: 5 additions & 0 deletions example/data_aws_caller_identity.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
data "aws_region" "current" {}
data "aws_availability_zones" "this" {}
data "aws_caller_identity" "current" {}
data "aws_iam_account_alias" "current" {}

9 changes: 9 additions & 0 deletions example/module_cloudfront_example.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module "cloudfront_example" {
source = "git::ssh://[email protected]/osodevops/aws-terraform-module-cloudfront-s3.git"
s3_source_bukcet_name = local.example_bucket_name
distribution_fqdn = "example.domain-name.com"
distribution_name = "example"
hosted_zone_name = "domain-name.com"
common_tags = var.common_tags
cloudfront_cache_compress_content = var.cloudfront_cache_compress_content
}
3 changes: 3 additions & 0 deletions example/provider.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
provider "aws" {
region = "eu-west-2"
}
6 changes: 6 additions & 0 deletions example/terraform.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
common_tags = {
Environment = "STAG"
CostCode = "S3"
TF_State = "s3_bucket"
Tool = "Terraform"
}
11 changes: 11 additions & 0 deletions example/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
variable "common_tags" {
type = map(string)
}

variable "cloudfront_cache_compress_content" {
type = bool
default = true
}
locals {
example_bucket_name = "example-${data.aws_region.current.name}-${lower(data.aws_iam_account_alias.current.account_alias)}"
}
9 changes: 7 additions & 2 deletions terraform.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
terraform {
required_version = ">= 0.13.5"
}
required_providers {
aws = {
source = "hashicorp/aws"
version = "4.60.0"
}
}
}

0 comments on commit 8e5600b

Please sign in to comment.