Skip to content

fix: Issue #2305 - Fix diff recognition for removal of network security group IDs in oci_apigateway_gateway #2307

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rvajustin
Copy link

Summary:

This PR addresses an issue where updating an API Gateway to remove all associated network security group IDs does not trigger a change in Terraform. The resource update logic fails to send an empty list for network_security_group_ids when they are removed, resulting in the NSG remaining attached.

Changes:

  • Update Handling: Modified both the create and update functions so that the network security group IDs field is always assigned to the update request.
  • Explicit Change Detection: In the update function, the logic now checks with s.D.HasChange("network_security_group_ids") and explicitly assigns the (possibly empty) list to request.NetworkSecurityGroupIds.
  • Consistency: These changes ensure that when the NSG IDs are removed from the configuration, an empty list is sent to the API, prompting the correct removal of the association.

Testing:

  1. Create an API Gateway with a non-empty network_security_group_ids.
  2. Update the Terraform configuration to remove the NSG IDs.
  3. Execute terraform plan and terraform apply to verify that the NSG is properly removed from the API Gateway.

This fix ensures that the Terraform provider correctly detects the removal of NSG IDs and aligns the actual state of the API Gateway with the desired configuration.

Copy link

Thank you for your pull request and welcome to our community! To contribute, please sign the Oracle Contributor Agreement (OCA).
The following contributors of this PR have not signed the OCA:

  • PR author: rvajustin

To sign the OCA, please create an Oracle account and sign the OCA in Oracle's Contributor Agreement Application.

When signing the OCA, please provide your GitHub username. After signing the OCA and getting an OCA approval from Oracle, this PR will be automatically updated.

If you are an Oracle employee, please make sure that you are a member of the main Oracle GitHub organization, and your membership in this organization is public.

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Required At least one contributor does not have an approved Oracle Contributor Agreement. label Feb 28, 2025
@tf-oci-pub tf-oci-pub added the Pending Test Pending Test label for PRs label Feb 28, 2025
@tf-oci-pub
Copy link
Member

Thank you for your valuable contribution. We greatly appreciate your efforts in submitting this pull request. However, I regret to inform you that we are unable to merge it directly on GitHub at this time.

Our internal policy requires that all pull requests undergo thorough local testing and review before they can be merged into the main codebase. This process ensures the quality and stability of Terraform-Provider-OCI.

We understand that this may cause some inconvenience, but please rest assured that your contribution is highly valued. Our team will carefully review and test your changes locally to ensure they meet our standards.

We appreciate your understanding and patience in this matter. If you have any questions or need further assistance, please don't hesitate to reach out. Thank you once again for your contribution.

Copy link

Thank you for signing the OCA.

@oracle-contributor-agreement oracle-contributor-agreement bot added OCA Verified All contributors have signed the Oracle Contributor Agreement. and removed OCA Required At least one contributor does not have an approved Oracle Contributor Agreement. labels Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement. Pending Test Pending Test label for PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants