Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Requires a "region" that is not documented #186

Open
marcottedan opened this issue Sep 7, 2021 · 2 comments
Open

Requires a "region" that is not documented #186

marcottedan opened this issue Sep 7, 2021 · 2 comments
Labels
bug 🐛 An issue with the system

Comments

@marcottedan
Copy link

Found a bug? Maybe our Slack Community can help.

Slack Community

Describe the Bug

Hi! When I use your module:

module "cdn" {
  source = "cloudposse/cloudfront-s3-cdn/aws"
  version = "0.75.0"

  namespace         = "ir"
  stage             = "dev"
  name              = "cdn"
  aliases           = ["cdn.example.com"]
  dns_alias_enabled = true
  parent_zone_name  = "example.com"

  deployment_principal_arns = {
    "arn:aws:iam::123456789012:role/principal1" = ["prefix1/", "prefix2/"]
    "arn:aws:iam::123456789012:role/principal2" = [""]
  }
}

I get the following error which I'm not sure how to fix:

terraform plan
╷
│ Error: Missing required argument
│ 
│ The argument "region" is required, but was not set.

I tried to set a AWS provider:

provider "aws" {
  region = "us-east-1"
  profile = "my-aws-account-profile-dev"
}

But then I get the following error:

╷
│ Error: no matching Route53Zone found
│ 
│   with module.cdn.module.dns.data.aws_route53_zone.default[0],
│   on .terraform/modules/cdn.dns/main.tf line 1, in data "aws_route53_zone" "default":
│    1: data "aws_route53_zone" "default" {
│ 
╵

Expected Behavior

I think I should have an AWS generated cloudfront with their domain name no?

Steps to Reproduce

Steps to reproduce the behavior:

  1. Use your template in a main.tf
  2. terraform plan

Screenshots

N/A

Environment (please complete the following information):

Anything that will help us triage the bug will help. Here are some ideas:

  • MacOS
    terraform -version
    Terraform v1.0.5
    on darwin_amd64
  • provider registry.terraform.io/hashicorp/aws v3.57.0
  • provider registry.terraform.io/hashicorp/local v2.1.0
  • provider registry.terraform.io/hashicorp/random v3.1.0

Additional Context

N/A

@marcottedan marcottedan added the bug 🐛 An issue with the system label Sep 7, 2021
@marcottedan
Copy link
Author

marcottedan commented Sep 7, 2021

OK I had to do the following change so the base example works:

module "cdn" {
  source = "cloudposse/cloudfront-s3-cdn/aws"
  version = "0.75.0"

  namespace         = "ir"
  stage             = "dev"
  name              = "cdn"
//  aliases           = ["cdn.example.com"]
  dns_alias_enabled = false
//  parent_zone_name  = "example.com"

  deployment_principal_arns = {
    "arn:aws:iam::123456789012:role/principal1" = ["prefix1/", "prefix2/"]
    "arn:aws:iam::123456789012:role/principal2" = [""]
  }
}

But then I got the following error:

╷
│ Error: Error putting S3 policy: MalformedPolicy: Invalid principal in policy
│       status code: 400, request id: 3JRRR9XPXSJ5VYBQ, host id: wTwGdC0Gro7MxFwe6BvnQ7Vq3AsltjUsM2HnBGs9QoOLKGz14tzyRm5Px76yyyqqs1CusKRgaOo=
│ 
│   with module.cdn.aws_s3_bucket_policy.default[0],
│   on .terraform/modules/cdn/main.tf line 221, in resource "aws_s3_bucket_policy" "default":
│  221: resource "aws_s3_bucket_policy" "default" {
│ 
╵

I'm not sure how/where to configure those principals so I'll investigate that.

@olivatooo
Copy link

I'm having the same problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 An issue with the system
Projects
None yet
Development

No branches or pull requests

2 participants