#terraform-aws-modules - September 2019

September 2019
cabrinha
cabrinhaabout 7 years ago
Does this s3 bucket module support CORS rules? https://github.com/cloudposse/terraform-aws-s3-bucket/tree/0.3.1
cabrinha
cabrinhaabout 7 years ago
I see there is a value for "var.policy" but I'm not sure if I can pass cors rules in there
Robert
Robertabout 7 years ago
It does not:
Robert
Robertabout 7 years ago
But I am sure that you could put in a PR to make it so that it does.
Robert
Robertabout 7 years ago
@cabrinha
Robert
Robertabout 7 years ago
You might have to do some count magic though with two bucket resources in the module since that is a resource block and not a map.
Robert
Robertabout 7 years ago
😕
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)about 7 years ago
@cabrinha you might prefer our s3 website module if you want to work with websites
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)about 7 years ago
The bucket module we have now is more for private buckets
cabrinha
cabrinhaabout 7 years ago
Ah thanks
antonbabenko
antonbabenkoabout 7 years ago(edited)
Hi guys! Since we are #terraform-aws-modules channel 🙂 Shameless plug, https://github.com/terraform-aws-modules/terraform-aws-s3-bucket - this module supports ALL (all I can imagine at least) features provided by Terraform AWS provider. See complete example code - https://github.com/terraform-aws-modules/terraform-aws-s3-bucket/blob/master/examples/complete/main.tf
Igor
Igorabout 7 years ago
@antonbabenko Excellent module. Is there any way/workaround to have the storage class be non standard by default and/or have a shorter than 30 day transition period?
antonbabenko
antonbabenkoabout 7 years ago
Yes, I believe so if it is supported by the AWS provider
Igor
Igorabout 7 years ago
I need to look into it, but last I checked, I didn't think that was possible
antonbabenko
antonbabenkoabout 7 years ago
I think I saw something like 30 days minimum, so you are probably right. It is a limit of AWS, not Terraform.
rohit
rohitabout 7 years ago
Does anyone know if the terraform-aws-rds module supports serverless mode for postgresql?
Shannon Dunn
Shannon Dunnabout 7 years ago
would the team accept PRs enabling some of these modules workable in AWS govcloud?
Shannon Dunn
Shannon Dunnabout 7 years ago
specifically around hardcoded arn formats
Khun
Khunabout 7 years ago
Hi, https://github.com/cloudposse/terraform-aws-kops-chart-repo/blob/master/main.tf#L24 - is this possible to override this so that this bucket won’t have versioning?
joshmyers
joshmyersabout 7 years ago
@Khun Open a PR
joshmyers
joshmyersabout 7 years ago
Why would you not want versioning on a thing?
Ryan
Ryanabout 7 years ago
Anyone know why I’m getting this error trying to add my ASG instances to an ALB target group:

Please ensure all provided Target Groups have target type of instance


Not sure if it’s how I have my ASG configured or what… the terraform-aws-alb module hard codes the target group type to ip, but the aws_autoscaling_group resource doesn’t specify anything about target group type. Assuming I’m doing something wrong because this seems like the modules for ALB/ASG would never interoperate correctly. 😕
Ryan
Ryanabout 7 years ago
Changing target_type to instance resolves this error in 0.12
Alain Deleglise
Alain Delegliseabout 7 years ago
Hi all
Alain Deleglise
Alain Delegliseabout 7 years ago
I'm quite new to terraform for aws
Alain Deleglise
Alain Delegliseabout 7 years ago
I'm currently trying to clean our existing AWS ressources, and I want to use the terraform-aws-iam-s3-user
Alain Deleglise
Alain Delegliseabout 7 years ago
I'm trying to add a single iam user, and his access to a bucket, for staging and production env
Alain Deleglise
Alain Delegliseabout 7 years ago
The problem is that the "aws_iam_user_policy.default[0]" created by the staging user will be replaced by the prod user
Alain Deleglise
Alain Delegliseabout 7 years ago
What am I doing wrong
Alain Deleglise
Alain Delegliseabout 7 years ago
?
Alain Deleglise
Alain Delegliseabout 7 years ago

Terraform will perform the following actions:

  # aws_iam_user_policy.default[0] must be replaced
-/+ resource "aws_iam_user_policy" "default" {
      ~ id     = "redacted-staging-bunny-audio:redacted-staging-bunny-audio" -> (known after apply)
      ~ name   = "redacted-staging-bunny-audio" -> "redacted-production-bunny-audio" # forces replacement
Alain Deleglise
Alain Delegliseabout 7 years ago
I've created a tfvars file for each user
Van Johnson
Van Johnsonabout 7 years ago
Could you share your tf files?
Sharanya
Sharanyaabout 7 years ago
Powershell script to - install nuget server ? did anyone write this script
jetstreamin
jetstreaminabout 7 years ago(edited)
@Sharanya $sourceNugetExe = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe"
$targetNugetExe = "$rootPath\nuget.exe"
Invoke-WebRequest $sourceNugetExe -OutFile $targetNugetExe
Set-Alias nuget $targetNugetExe -Scope Global -Verbose
jetstreamin
jetstreaminabout 7 years ago
not sure if that's what you need specifically but that will installed nuget
jetstreamin
jetstreaminabout 7 years ago
If you want to install nuget in powershell as a provider Install-PackageProvider -Name NuGet
Sharanya
Sharanyaabout 7 years ago
@jetstreamin Thank you so much
leonawood
leonawoodabout 7 years ago
Can you use terraform_remote_state data source as an input attribute for subnet in the cloudposse aws ec2 module?
leonawood
leonawoodabout 7 years ago
oh wait, I apologize this channel is not for cloudposse modules
Sharanya
Sharanyaabout 7 years ago(edited)
Components for secure UI hosting in S3
• S3 — for storing the static site
• CloudFront — for serving the static site over SSL
• AWS Certificate Manager — for generating the SSL certificates
Route53 — for routing the domain name to the correct location Did anyone come across any modules for this in terraform ?
guigo2k
guigo2kabout 7 years ago
@Andriy Knysh (Cloud Posse) thanks for updating the EC2 autoscaling module 🎉
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)about 7 years ago
no problem 🙂
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)about 7 years ago
all EKS modules should be done for TF 0.12 today
oscar
oscarabout 7 years ago
The hero we need, but not the hero we deserve.

Big thanks @Andriy Knysh (Cloud Posse) 🙇
Rajesh Babu Gangula
Rajesh Babu Gangulaabout 7 years ago(edited)
@here I am trying to upgrade from v.11.14 to v.12 and after going through the upgrade steps and fixing some code changes ... now I am seeing following issue

Error: Missing resource instance key

  on .terraform/modules/public_subnets.public_label/outputs.tf line 29, in output "tags":
  29:         "Stage", "${null_resource.default.triggers.stage}"

Because null_resource.default has "count" set, its attributes must be accessed
on specific instances.

For example, to correlate with indices of a referring resource, use:
    null_resource.default[count.index]

did anyone faced similar issue and was able to fix it
Rajesh Babu Gangula
Rajesh Babu Gangulaabout 7 years ago

Downloading git::<https://github.com/cloudposse/terraform-aws-vpc.git?ref=0.8.0> for base_vpc...
- base_vpc in .terraform/modules/base_vpc
Downloading git::<https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.14.0> for base_vpc.label...
- base_vpc.label in .terraform/modules/base_vpc.label
Downloading git::<https://github.com/cloudposse/terraform-aws-multi-az-subnets.git?ref=master> for private_subnets...
- private_subnets in .terraform/modules/private_subnets
Downloading git::<https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.3.0> for private_subnets.private_label...
- private_subnets.private_label in .terraform/modules/private_subnets.private_label
Downloading git::<https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.3.0> for private_subnets.public_label...
- private_subnets.public_label in .terraform/modules/private_subnets.public_label
Downloading git::<https://github.com/cloudposse/terraform-aws-multi-az-subnets.git?ref=master> for public_subnets...
- public_subnets in .terraform/modules/public_subnets
Downloading git::<https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.3.0> for public_subnets.private_label...
- public_subnets.private_label in .terraform/modules/public_subnets.private_label
Downloading git::<https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.3.0> for public_subnets.public_label...
- public_subnets.public_label in .terraform/modules/public_subnets.public_label
oscar
oscarabout 7 years ago
Did you do what the error said? It is correct
Alex Co
Alex Coabout 7 years ago
hi i’m using the terraform iam role module
Alex Co
Alex Coabout 7 years ago
while init the module with release 0.4.0, i got this error
Alex Co
Alex Coabout 7 years ago

Error: Invalid argument name

  on .terraform/modules/role.aggregated_policy/main.tf line 24, in data "aws_iam_policy_document" "zero":
  24:   "statement"   = []

Argument names must not be quoted.
Alex Co
Alex Coabout 7 years ago
anyone know how to fix this ?
Alex Co
Alex Coabout 7 years ago
thanks
Alex Co
Alex Coabout 7 years ago
i’m using terraform 0.12.9
Rajesh Babu Gangula
Rajesh Babu Gangulaabout 7 years ago
"statement" ==> statement -- remove the quotes
Rajesh Babu Gangula
Rajesh Babu Gangulaabout 7 years ago
@Alex Co