-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Commit
aws_controltower_landing_zone
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
// Copyright (c) HashiCorp, Inc. | ||
// SPDX-License-Identifier: MPL-2.0 | ||
|
||
package controltower | ||
|
||
import ( | ||
"context" | ||
"time" | ||
|
||
"github.com/hashicorp/terraform-plugin-sdk/v2/diag" | ||
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" | ||
"github.com/hashicorp/terraform-provider-aws/internal/conns" | ||
"github.com/hashicorp/terraform-provider-aws/internal/verify" | ||
) | ||
|
||
// @SDKResource("aws_controltower_landing_zone", name="Landing Zone") | ||
func resourceLandingZone() *schema.Resource { | ||
return &schema.Resource{ | ||
CreateWithoutTimeout: resourceLandingZoneCreate, | ||
ReadWithoutTimeout: resourceLandingZoneRead, | ||
DeleteWithoutTimeout: resourceLandingZoneDelete, | ||
|
||
Importer: &schema.ResourceImporter{ | ||
StateContext: schema.ImportStatePassthroughContext, | ||
}, | ||
|
||
Timeouts: &schema.ResourceTimeout{ | ||
Create: schema.DefaultTimeout(120 * time.Minute), | ||
Delete: schema.DefaultTimeout(120 * time.Minute), | ||
}, | ||
|
||
Schema: map[string]*schema.Schema{ | ||
"control_identifier": { | ||
Type: schema.TypeString, | ||
Required: true, | ||
ForceNew: true, | ||
ValidateFunc: verify.ValidARN, | ||
}, | ||
"target_identifier": { | ||
Type: schema.TypeString, | ||
Required: true, | ||
ForceNew: true, | ||
ValidateFunc: verify.ValidARN, | ||
}, | ||
}, | ||
} | ||
} | ||
|
||
func resourceLandingZoneCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { | ||
conn := meta.(*conns.AWSClient).ControlTowerClient(ctx) | ||
Check failure on line 50 in internal/service/controltower/landing_zone.go GitHub Actions / go build
Check failure on line 50 in internal/service/controltower/landing_zone.go GitHub Actions / providerlint
Check failure on line 50 in internal/service/controltower/landing_zone.go GitHub Actions / providerlint
Check failure on line 50 in internal/service/controltower/landing_zone.go GitHub Actions / providerlint
Check failure on line 50 in internal/service/controltower/landing_zone.go GitHub Actions / providerlint
Check failure on line 50 in internal/service/controltower/landing_zone.go GitHub Actions / 1 of 2
|
||
|
||
return resourceLandingZoneRead(ctx, d, meta) | ||
} | ||
|
||
func resourceLandingZoneRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { | ||
conn := meta.(*conns.AWSClient).ControlTowerClient(ctx) | ||
Check failure on line 56 in internal/service/controltower/landing_zone.go GitHub Actions / go build
Check failure on line 56 in internal/service/controltower/landing_zone.go GitHub Actions / providerlint
Check failure on line 56 in internal/service/controltower/landing_zone.go GitHub Actions / providerlint
Check failure on line 56 in internal/service/controltower/landing_zone.go GitHub Actions / providerlint
Check failure on line 56 in internal/service/controltower/landing_zone.go GitHub Actions / 1 of 2
|
||
|
||
return nil | ||
} | ||
|
||
func resourceLandingZoneDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { | ||
conn := meta.(*conns.AWSClient).ControlTowerClient(ctx) | ||
Check failure on line 62 in internal/service/controltower/landing_zone.go GitHub Actions / go build
Check failure on line 62 in internal/service/controltower/landing_zone.go GitHub Actions / providerlint
Check failure on line 62 in internal/service/controltower/landing_zone.go GitHub Actions / providerlint
Check failure on line 62 in internal/service/controltower/landing_zone.go GitHub Actions / providerlint
Check failure on line 62 in internal/service/controltower/landing_zone.go GitHub Actions / 1 of 2
|
||
|
||
return nil | ||
} |