Skip to content

Conversation

@Gezi-lzq
Copy link
Collaborator

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds support for multiple security groups in the Kafka instance resource at the compute_specs level. The change migrates from a singular security group API field to a plural security groups field that accepts a list of security group IDs.

Changes:

  • Updated client models to use SecurityGroups []string instead of SecurityGroup *string in API structs
  • Added security_groups list attribute to compute_specs in both resource and datasource schemas
  • Implemented expansion and flattening logic with proper null/unknown handling
  • Added comprehensive test coverage for validation, expansion, and flattening scenarios

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
client/model_kafka_instance.go Changed API field from singular SecurityGroup (*string) to plural SecurityGroups ([]string) across SpecificationParam, SpecificationVO, and SpecificationUpdateParam
internal/provider/resource_instance.go Added security_groups list attribute to compute_specs schema with validation requiring at least 1 item and replacement plan modifier
internal/provider/datasource_instance.go Added computed security_groups list attribute to datasource schema
internal/models/kafka_instance.go Added SecurityGroups field to ComputeSpecsModel, implemented expansion and flattening logic with proper null/unknown state handling
internal/models/kafka_instance_test.go Added comprehensive tests for expanding and flattening security_groups with multiple scenarios (null, single, multiple values)
internal/provider/resource_instance_validation_test.go Added test for compute_specs security_groups validator ensuring empty lists are rejected and non-empty lists are accepted
examples/resources/automq_kafka_instance/resource.tf Added commented example showing optional security_groups usage
docs/resources/kafka_instance.md Added security_groups documentation to compute_specs attributes
docs/data-sources/kafka_instance.md Added security_groups documentation to compute_specs read-only attributes

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Gezi-lzq Gezi-lzq merged commit 093748b into main Jan 13, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants