Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/45311.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/aws_api_gateway_integration: Add VPC Link V2 to ApiGateway private backend
```
18 changes: 18 additions & 0 deletions internal/service/apigateway/integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag"
"github.com/hashicorp/terraform-provider-aws/internal/flex"
"github.com/hashicorp/terraform-provider-aws/internal/tfresource"
"github.com/hashicorp/terraform-provider-aws/internal/verify"
"github.com/hashicorp/terraform-provider-aws/names"
)

Expand Down Expand Up @@ -68,6 +69,11 @@ func resourceIntegration() *schema.Resource {
Type: schema.TypeString,
Optional: true,
},
"integration_target": {
Type: schema.TypeString,
Optional: true,
ValidateFunc: verify.ValidARN,
},
"connection_type": {
Type: schema.TypeString,
Optional: true,
Expand Down Expand Up @@ -220,6 +226,9 @@ func resourceIntegrationCreate(ctx context.Context, d *schema.ResourceData, meta
if v, ok := d.GetOk("tls_config"); ok && len(v.([]any)) > 0 {
input.TlsConfig = expandTLSConfig(v.([]any))
}
if v, ok := d.GetOk("integration_target"); ok {
input.IntegrationTarget = aws.String(v.(string))
}

if v, ok := d.GetOk(names.AttrURI); ok {
input.Uri = aws.String(v.(string))
Expand Down Expand Up @@ -261,6 +270,7 @@ func resourceIntegrationRead(ctx context.Context, d *schema.ResourceData, meta a
d.Set("content_handling", integration.ContentHandling)
d.Set("credentials", integration.Credentials)
d.Set("integration_http_method", integration.HttpMethod)
d.Set("integration_target", integration.IntegrationTarget)
d.Set("passthrough_behavior", integration.PassthroughBehavior)
d.Set("request_parameters", integration.RequestParameters)
// We need to explicitly convert key = nil values into key = "", which aws.ToStringMap() removes
Expand Down Expand Up @@ -462,6 +472,14 @@ func resourceIntegrationUpdate(ctx context.Context, d *schema.ResourceData, meta
}
}

if d.HasChange("integration_target") {
operations = append(operations, types.PatchOperation{
Op: types.OpReplace,
Path: aws.String("/integrationTarget"),
Value: aws.String(d.Get("integration_target").(string)),
})
}

// Updating, Stage 1: Everything except cache key parameters

// Updating is handled in two stages because of the challenges of keeping AWS and state in sync in
Expand Down
Loading
Loading