-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34595 from bschaatsbergen/f/controltower-landingzone
[New Resource]: `aws_controltower_landing_zone`
- Loading branch information
Showing
11 changed files
with
865 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
```release-note:new-resource | ||
aws_controltower_landing_zone | ||
``` | ||
|
||
```release-note:note | ||
resource/aws_controltower_landing_zone: Because we cannot easily test this functionality, it is best effort and we ask for community help in testing | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Copyright (c) HashiCorp, Inc. | ||
// SPDX-License-Identifier: MPL-2.0 | ||
|
||
package json | ||
|
||
import ( | ||
"encoding/json" | ||
|
||
smithydocument "github.com/aws/smithy-go/document" | ||
) | ||
|
||
func SmithyDocumentFromString[T smithydocument.Marshaler](s string, f func(any) T) (T, error) { | ||
var v map[string]interface{} | ||
|
||
err := json.Unmarshal([]byte(s), &v) | ||
if err != nil { | ||
var zero T | ||
return zero, err | ||
} | ||
|
||
return f(v), nil | ||
} | ||
|
||
// SmithyDocumentToString converts a [Smithy document](https://smithy.io/2.0/spec/simple-types.html#document) to a JSON string. | ||
func SmithyDocumentToString(document smithydocument.Unmarshaler) (string, error) { | ||
var v map[string]interface{} | ||
|
||
err := document.UnmarshalSmithyDocument(&v) | ||
if err != nil { | ||
return "", err | ||
} | ||
|
||
bytes, err := json.Marshal(v) | ||
if err != nil { | ||
return "", err | ||
} | ||
|
||
return string(bytes), nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright (c) HashiCorp, Inc. | ||
// SPDX-License-Identifier: MPL-2.0 | ||
|
||
package controltower_test | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/hashicorp/terraform-provider-aws/internal/acctest" | ||
) | ||
|
||
func TestAccControlTower_serial(t *testing.T) { | ||
t.Parallel() | ||
|
||
testCases := map[string]map[string]func(t *testing.T){ | ||
"LandingZone": { | ||
"basic": testAccLandingZone_basic, | ||
"disappears": testAccLandingZone_disappears, | ||
"tags": testAccLandingZone_tags, | ||
}, | ||
} | ||
|
||
acctest.RunSerialTests2Levels(t, testCases, 0) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.