Skip to content

Commit

Permalink
[NAT] import support for resource/opentelekomcloud_nat_snat_rule_v2 (
Browse files Browse the repository at this point in the history
…#2630)

[NAT] import support for `resource/opentelekomcloud_nat_snat_rule_v2`

Summary of the Pull Request
PR Checklist

 Refers to: #2622
 Tests added/passed.
 Documentation updated.
 Schema updated.
 Release notes added.

Acceptance Steps Performed
=== RUN   TestAccNatSnatRule_basic
--- PASS: TestAccNatSnatRule_basic (88.54s)
PASS

Debugger finished with the exit code 0

Reviewed-by: Artem Lifshits
  • Loading branch information
anton-sidelnikov authored Aug 21, 2024
1 parent c1c041d commit 4bfe78a
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/resources/nat_snat_rule_v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,11 @@ The following attributes are exported:
* `source_type` - See Argument Reference above.

* `cidr` - See Argument Reference above.

## Import

SNAT can be imported using the following format:

```sh
terraform import opentelekomcloud_nat_snat_rule_v2.snat_1 f4f783a7-b908-4215-b018-724960e5df4b
```
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ func TestAccNatSnatRule_basic(t *testing.T) {
testAccCheckNatV2SnatRuleExists(resourceSnatRuleName),
),
},
{
ResourceName: resourceSnatRuleName,
ImportState: true,
ImportStateVerify: true,
},
},
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ func ResourceNatSnatRuleV2() *schema.Resource {
Delete: schema.DefaultTimeout(10 * time.Minute),
},

Importer: &schema.ResourceImporter{
StateContext: schema.ImportStatePassthroughContext,
},

Schema: map[string]*schema.Schema{
"region": {
Type: schema.TypeString,
Expand Down
4 changes: 4 additions & 0 deletions releasenotes/notes/nat-snat-import-f120ce1232bc1c63.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
enhancements:
- |
**[NAT]** Import support added for ``resource/opentelekomcloud_nat_snat_rule_v2`` (`#2630 <https://github.com/opentelekomcloud/terraform-provider-opentelekomcloud/pull/2630>`_)

0 comments on commit 4bfe78a

Please sign in to comment.