hashicorp / terraform-provider-awscc

Terraform AWS Cloud Control provider
https://registry.terraform.io/providers/hashicorp/awscc/latest/docs
Mozilla Public License 2.0
249 stars 114 forks source link

Is awscc_opensearchserverless_access_policies, awscc_opensearchserverless_security_configs/policies (Data Source) supported? #1250

Open ikanni opened 11 months ago

ikanni commented 11 months ago

Community Note

Description

Is awscc_opensearchserverless_access_policies, awscc_opensearchserverless_security_configs/policies (Data Source) supported?

Terraform CLI and Terraform AWS Cloud Control Provider Version

Terraform v1.6.1
on linux_amd64
+ provider registry.terraform.io/hashicorp/aws v3.76.1
+ provider registry.terraform.io/hashicorp/awscc v0.1.0
+ provider registry.terraform.io/hashicorp/random v3.1.3

Affected Resource(s)

Terraform Configuration Files

Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.

terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 3.0"
    }
    awscc = {
      source  = "hashicorp/awscc"
      version = "~> 0.1.0"
    }
    random = {
      source  = "hashicorp/random"
      version = "~> 3.1.0"
    }
  }
}

provider "awscc" {
  region = "us-east-1"
}

#List all security policies
data "awscc_opensearchserverless_security_policies" "myisecuritypolicies"{
}

#List all security configs
data "awscc_opensearchserverless_security_configs" "myisecurityconfigs"{
}

#List all access policies
data "awscc_opensearchserverless_access_policies" "myaccesspolicies"{
}

Debug Output

Log: https://gist.github.com/ikanni/f0d18ff9fc0a21377e45fe2197a95a44 Screenshot output: image

Expected Behavior

Above resources should not be supported as the ListResources fails with error Required property: [Type] when tested separately.

Actual Behavior

Terraform document is telling that above resource is supported. But it fails when we try.

Steps to Reproduce

  1. terraform init
  2. terraform apply

References

Somehow the all_schemas.hcl does not have suppress_plural_data_source_generation = true for the above resource. But the generators/allschemas/available_schemas.2023-10-11.hcl has the suppress_plural_data_source_generation = true

image

ikanni commented 11 months ago

General question: When we review the Cloud Control API doc for the AWS::Logs::LogStream List call is supported (related screen pasted below). Why terraform-provider-awscc is marking with suppress_plural_data_source_generation = true for AWS::Logs::LogStream when the ListResources call fails?

Screen from the doc: image