terraform-provider-awscc
terraform-provider-awscc copied to clipboard
Kendra Create Index Error: Value '' at 'identifier' failed to satisfy constraint
Community Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
- Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment
- The resources and data sources in this provider are generated from the CloudFormation schema, so they can only support the actions that the underlying schema supports. For this reason submitted bugs should be limited to defects in the generation and runtime code of the provider. Customizing behavior of the resource, or noting a gap in behavior are not valid bugs and should be submitted as enhancements to AWS via the CloudFormation Open Coverage Roadmap.
Terraform CLI and Terraform AWS Cloud Control Provider Version
Terraform v1.1.9 on darwin_amd64
- provider registry.terraform.io/hashicorp/aws v4.17.0
- provider registry.terraform.io/hashicorp/awscc v0.1.0
- provider registry.terraform.io/hashicorp/random v3.2.0
Affected Resource(s)
- awscc_kendra_index
Terraform Configuration Files
Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.
Note: there is a race condition when creating a new IAM Role for use by Kendra, the first apply fails. Wait 45 seconds and apply again.
see here: https://github.com/AdamTylerLynch/terraform-awscc-kendra-sample/blob/main/main.tf
Debug Output
awscc_kendra_index.demo-index: Still creating... [16m10s elapsed]
2022-06-08T08:17:14.384-0400 [DEBUG] provider.terraform-provider-awscc: 2022/06/08 08:17:14 [DEBUG] Resolving endpoint for "CloudControl" in "us-east-1"
2022-06-08T08:17:14.385-0400 [DEBUG] provider.terraform-provider-awscc: [aws-sdk-go-v2]: message="Request
POST / HTTP/1.1
Host: cloudcontrolapi.us-east-1.amazonaws.com
User-Agent: APN/1.0 HashiCorp/1.0 Terraform/1.1.9 (+https://www.terraform.io) terraform-provider-awscc/dev (+https://registry.terraform.io/providers/hashicorp/awscc) aws-sdk-go-v2/1.9.1 os/macos lang/go/1.16 md/GOOS/darwin md/GOARCH/amd64 api/cloudcontrol/1.0.0
Content-Length: 55
Amz-Sdk-Invocation-Id: 6d52ecfd-e20d-4422-b7e9-375ec0eedf4c
Amz-Sdk-Request: attempt=1; max=25
Authorization: AWS4-HMAC-SHA256 Credential=/20220608/us-east-1/cloudcontrolapi/aws4_request, SignedHeaders=amz-sdk-invocation-id;amz-sdk-request;content-length;content-type;host;x-amz-date;x-amz-security-token;x-amz-target, Signature=
Content-Type: application/x-amz-json-1.0
X-Amz-Date: 20220608T121714Z
X-Amz-Security-Token:
X-Amz-Target: CloudApiService.GetResourceRequestStatus
Accept-Encoding: gzip
{"RequestToken":"dd11ec93-cbc5-4328-a6f6-7b0bdd8e9554"}" timestamp=2022-06-08T08:17:14.385-0400
2022-06-08T08:17:15.495-0400 [DEBUG] provider.terraform-provider-awscc: [aws-sdk-go-v2]: message="Response
HTTP/1.1 200 OK
Content-Length: 235
Content-Type: application/x-amz-json-1.0
Date: Wed, 08 Jun 2022 12:17:15 GMT
X-Amzn-Requestid: 2792b397-8771-4c8b-8d6d-c91501f61d64
{"ProgressEvent":{"EventTime":1.654690573453E9,"Identifier":"8dabfd05-122b-4d46-ad24-3a9ba1a6ac09","Operation":"CREATE","OperationStatus":"SUCCESS","RequestToken":"dd11ec93-cbc5-4328-a6f6-7b0bdd8e9554","TypeName":"AWS::Kendra::Index"}}" timestamp=2022-06-08T08:17:15.495-0400
2022-06-08T08:17:15.495-0400 [DEBUG] provider.terraform-provider-awscc: FindResourceByTypeNameAndID: cfTypeName=AWS::Kendra::Index id= timestamp=2022-06-08T08:17:15.495-0400
2022-06-08T08:17:15.495-0400 [DEBUG] provider.terraform-provider-awscc: 2022/06/08 08:17:15 [DEBUG] Resolving endpoint for "CloudControl" in "us-east-1"
2022-06-08T08:17:15.496-0400 [DEBUG] provider.terraform-provider-awscc: [aws-sdk-go-v2]: message="Request
POST / HTTP/1.1
Host: cloudcontrolapi.us-east-1.amazonaws.com
User-Agent: APN/1.0 HashiCorp/1.0 Terraform/1.1.9 (+https://www.terraform.io) terraform-provider-awscc/dev (+https://registry.terraform.io/providers/hashicorp/awscc) aws-sdk-go-v2/1.9.1 os/macos lang/go/1.16 md/GOOS/darwin md/GOARCH/amd64 api/cloudcontrol/1.0.0
Content-Length: 49
Amz-Sdk-Invocation-Id: d6651962-c415-4689-b7ff-919daae73ed1
Amz-Sdk-Request: attempt=1; max=25
Authorization: AWS4-HMAC-SHA256 Credential=/20220608/us-east-1/cloudcontrolapi/aws4_request, SignedHeaders=amz-sdk-invocation-id;amz-sdk-request;content-length;content-type;host;x-amz-date;x-amz-security-token;x-amz-target, Signature=
Content-Type: application/x-amz-json-1.0
X-Amz-Date: 20220608T121715Z
X-Amz-Security-Token:
X-Amz-Target: CloudApiService.GetResource
Accept-Encoding: gzip
{"Identifier":"","TypeName":"AWS::Kendra::Index"}" timestamp=2022-06-08T08:17:15.496-0400
2022-06-08T08:17:16.584-0400 [DEBUG] provider.terraform-provider-awscc: [aws-sdk-go-v2]: message="Response
HTTP/1.1 400 Bad Request
Content-Length: 313
Content-Type: application/x-amz-json-1.0
Date: Wed, 08 Jun 2022 12:17:16 GMT
X-Amzn-Requestid: c48959b4-92de-4829-8e88-41706c3e245d
{"__type":"com.amazon.coral.validate#ValidationException","message":"2 validation errors detected: Value '' at 'identifier' failed to satisfy constraint: Member must satisfy regular expression pattern: .+; Value '' at 'identifier' failed to satisfy constraint: Member must have length greater than or equal to 1"}" timestamp=2022-06-08T08:17:16.584-0400
2022-06-08T08:17:16.584-0400 [DEBUG] provider.terraform-provider-awscc: [aws-sdk-go-v2]: message="request failed with unretryable error https response error StatusCode: 400, RequestID: c48959b4-92de-4829-8e88-41706c3e245d, api error ValidationException: 2 validation errors detected: Value '' at 'identifier' failed to satisfy constraint: Member must satisfy regular expression pattern: .+; Value '' at 'identifier' failed to satisfy constraint: Member must have length greater than or equal to 1" timestamp=2022-06-08T08:17:16.584-0400
2022-06-08T08:17:16.609-0400 [ERROR] vertex "awscc_kendra_index.demo-index" error: AWS SDK Go Service Operation Unsuccessful
2022-06-08T08:17:16.609-0400 [ERROR] vertex "awscc_kendra_index.demo-index" error: Provider returned invalid result object after apply
2022-06-08T08:17:16.609-0400 [ERROR] vertex "awscc_kendra_index.demo-index" error: Provider returned invalid result object after apply
2022-06-08T08:17:16.609-0400 [ERROR] vertex "awscc_kendra_index.demo-index" error: Provider returned invalid result object after apply
╷
│ Error: Provider returned invalid result object after apply
│
│ After the apply operation, the provider still indicated an unknown value for awscc_kendra_index.demo-index.arn. All values must be known after apply, so this
│ is always a bug in the provider and should be reported in the provider's own repository. Terraform will still save the other known object values in the
│ state.
╵
╷
│ Error: Provider returned invalid result object after apply
│
│ After the apply operation, the provider still indicated an unknown value for awscc_kendra_index.demo-index.id. All values must be known after apply, so this
│ is always a bug in the provider and should be reported in the provider's own repository. Terraform will still save the other known object values in the
│ state.
╵
╷
│ Error: Provider returned invalid result object after apply
│
│ After the apply operation, the provider still indicated an unknown value for awscc_kendra_index.demo-index.server_side_encryption_configuration. All values
│ must be known after apply, so this is always a bug in the provider and should be reported in the provider's own repository. Terraform will still save the
│ other known object values in the state.
╵
╷
│ Error: AWS SDK Go Service Operation Unsuccessful
│
│ with awscc_kendra_index.demo-index,
│ on main.tf line 9, in resource "awscc_kendra_index" "demo-index":
│ 9: resource "awscc_kendra_index" "demo-index" {
│
│ Calling Cloud Control API service GetResource operation returned: operation error CloudControl: GetResource, https response error StatusCode: 400, RequestID:
│ c48959b4-92de-4829-8e88-41706c3e245d, api error ValidationException: 2 validation errors detected: Value '' at 'identifier' failed to satisfy constraint:
│ Member must satisfy regular expression pattern: .+; Value '' at 'identifier' failed to satisfy constraint: Member must have length greater than or equal to 1
╵
2022-06-08T08:17:16.634-0400 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing"
2022-06-08T08:17:16.638-0400 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/hashicorp/awscc/0.1.0/darwin_amd64/terraform-provider-awscc pid=39194
2022-06-08T08:17:16.638-0400 [DEBUG] provider: plugin exited
Expected Behavior
Actual Behavior
Error after create.
Steps to Reproduce
terraform apply
I believe there is an issue with the IAM policy. Can you try updating this line to be AWS/Kendra not Kendra. Not sure if thats causing the issue or not here
This may (well) be due to the fact that the Kendra Index resource defines it's own Id property and we don't have to synthesize one...