Skip to content

Commit

Permalink
feat: implement aws_controltower_landing_zone
Browse files Browse the repository at this point in the history
  • Loading branch information
bschaatsbergen committed Nov 28, 2023
1 parent 816aa99 commit 208ac08
Showing 1 changed file with 65 additions and 0 deletions.
65 changes: 65 additions & 0 deletions internal/service/controltower/landing_zone.go
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

View workflow job for this annotation

GitHub Actions / go build

conn declared and not used

Check failure on line 50 in internal/service/controltower/landing_zone.go

View workflow job for this annotation

GitHub Actions / providerlint

conn declared and not used

Check failure on line 50 in internal/service/controltower/landing_zone.go

View workflow job for this annotation

GitHub Actions / providerlint

conn declared and not used

Check failure on line 50 in internal/service/controltower/landing_zone.go

View workflow job for this annotation

GitHub Actions / providerlint

conn declared and not used

Check failure on line 50 in internal/service/controltower/landing_zone.go

View workflow job for this annotation

GitHub Actions / providerlint

conn declared and not used

Check failure on line 50 in internal/service/controltower/landing_zone.go

View workflow job for this annotation

GitHub Actions / 1 of 2

conn declared and not used

Check failure on line 50 in internal/service/controltower/landing_zone.go

View workflow job for this annotation

GitHub Actions / build-32-bit

conn declared and not used

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

View workflow job for this annotation

GitHub Actions / go build

conn declared and not used

Check failure on line 56 in internal/service/controltower/landing_zone.go

View workflow job for this annotation

GitHub Actions / providerlint

conn declared and not used

Check failure on line 56 in internal/service/controltower/landing_zone.go

View workflow job for this annotation

GitHub Actions / providerlint

conn declared and not used

Check failure on line 56 in internal/service/controltower/landing_zone.go

View workflow job for this annotation

GitHub Actions / providerlint

conn declared and not used

Check failure on line 56 in internal/service/controltower/landing_zone.go

View workflow job for this annotation

GitHub Actions / 1 of 2

conn declared and not used

Check failure on line 56 in internal/service/controltower/landing_zone.go

View workflow job for this annotation

GitHub Actions / build-32-bit

conn declared and not used

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

View workflow job for this annotation

GitHub Actions / go build

conn declared and not used

Check failure on line 62 in internal/service/controltower/landing_zone.go

View workflow job for this annotation

GitHub Actions / providerlint

conn declared and not used

Check failure on line 62 in internal/service/controltower/landing_zone.go

View workflow job for this annotation

GitHub Actions / providerlint

conn declared and not used

Check failure on line 62 in internal/service/controltower/landing_zone.go

View workflow job for this annotation

GitHub Actions / providerlint

conn declared and not used

Check failure on line 62 in internal/service/controltower/landing_zone.go

View workflow job for this annotation

GitHub Actions / 1 of 2

conn declared and not used) (typecheck)

Check failure on line 62 in internal/service/controltower/landing_zone.go

View workflow job for this annotation

GitHub Actions / build-32-bit

conn declared and not used

return nil
}

0 comments on commit 208ac08

Please sign in to comment.