zheli / harmony-cloudwatch-synthetic-canary-scripts

AWS Cloudwatch Synthetics Canary scripts for every RPC method and workflow.
MIT License
4 stars 4 forks source link

Errors when running terraform apply #1

Open givp opened 3 years ago

givp commented 3 years ago

When I try to create the canaries, I get an error like this for every test in the terminal. Any ideas?

> terraform apply -var="account_id=123456789" -var="s3=terraform-scripts"

│ Error: error starting Synthetics Canary: InvalidParameter: 1 validation error(s) found.
│ - minimum field size of 1, StartCanaryInput.Name.
│
│
│   with aws_synthetics_canary.main["all_validator_address"],
│   on canary.tf line 25, in resource "aws_synthetics_canary" "main":
│   25: resource "aws_synthetics_canary" "main" {
│
╵
╷
│ Error: error starting Synthetics Canary: InvalidParameter: 1 validation error(s) found.
│ - minimum field size of 1, StartCanaryInput.Name.
│
│
│   with aws_synthetics_canary.main["call"],
│   on canary.tf line 25, in resource "aws_synthetics_canary" "main":
│   25: resource "aws_synthetics_canary" "main" {
│
╵
╷
│ Error: error starting Synthetics Canary: InvalidParameter: 1 validation error(s) found.
│ - minimum field size of 1, StartCanaryInput.Name.
│
│
│   with aws_synthetics_canary.main["utility_metric"],
│   on canary.tf line 25, in resource "aws_synthetics_canary" "main":
│   25: resource "aws_synthetics_canary" "main" {
zheli commented 3 years ago

Could you run terraform version and paste the output here? :slightly_smiling_face: Thanks!

zheli commented 3 years ago

Or maybe we can schedule a video call if it is faster.

givp commented 3 years ago

Could you run terraform version and paste the output here? 🙂 Thanks! @zheli

▻ terraform version
Terraform v1.0.1
on darwin_amd64
+ provider registry.terraform.io/hashicorp/archive v2.2.0
+ provider registry.terraform.io/hashicorp/aws v3.47.0
+ provider registry.terraform.io/hashicorp/null v3.1.0
zheli commented 3 years ago

Does that S3 bucket exist? :slightly_smiling_face: My Terraform script doesn't create the bucket automatically, but I can add that of course.

zheli commented 3 years ago

If the S3 bucket exists, perhaps you can try TF_LOG=DEBUG terraform apply -var="account_id=123456789" -var="s3=terraform-scripts". And look for something like this:

2021-06-30T19:28:04.659+0200 [INFO]  provider.terraform-provider-aws_v3.47.0_x5: 2021/06/30 19:28:04 [DEBUG] [aws-sdk-go] DEBUG: Response synthetics/CreateCanary Details:
---[ RESPONSE ]--------------------------------------
HTTP/2.0 400 Bad Request
Content-Length: 66
Content-Type: application/json
Date: Wed, 30 Jun 2021 17:28:04 GMT
X-Amz-Apigw-Id: Bv9w0HwoDoEFiNg=
X-Amzn-Errortype: ValidationException
X-Amzn-Requestid: 72325451-5968-4c16-b999-d3221e7f8254
X-Amzn-Trace-Id: Root=1-60dca99e-455c9e273c53d687078c4d0c

-----------------------------------------------------: timestamp=2021-06-30T19:28:04.659+0200
2021-06-30T19:28:04.659+0200 [INFO]  provider.terraform-provider-aws_v3.47.0_x5: 2021/06/30 19:28:04 [DEBUG] [aws-sdk-go] {
  "Message" : "{reason why the request failed}"
}: timestamp=2021-06-30T19:28:04.659+0200
zheli commented 3 years ago

@givp

givp commented 3 years ago

If the S3 bucket exists, perhaps you can try TF_LOG=DEBUG terraform apply -var="account_id=123456789" -var="s3=terraform-scripts". And look for something like this:

2021-06-30T19:28:04.659+0200 [INFO]  provider.terraform-provider-aws_v3.47.0_x5: 2021/06/30 19:28:04 [DEBUG] [aws-sdk-go] DEBUG: Response synthetics/CreateCanary Details:
---[ RESPONSE ]--------------------------------------
HTTP/2.0 400 Bad Request
Content-Length: 66
Content-Type: application/json
Date: Wed, 30 Jun 2021 17:28:04 GMT
X-Amz-Apigw-Id: Bv9w0HwoDoEFiNg=
X-Amzn-Errortype: ValidationException
X-Amzn-Requestid: 72325451-5968-4c16-b999-d3221e7f8254
X-Amzn-Trace-Id: Root=1-60dca99e-455c9e273c53d687078c4d0c

-----------------------------------------------------: timestamp=2021-06-30T19:28:04.659+0200
2021-06-30T19:28:04.659+0200 [INFO]  provider.terraform-provider-aws_v3.47.0_x5: 2021/06/30 19:28:04 [DEBUG] [aws-sdk-go] {
  "Message" : "{reason why the request failed}"
}: timestamp=2021-06-30T19:28:04.659+0200

@zheli thanks, I'll give that a try.