# GatewayTargetApiGatewayProps

Properties for creating an API Gateway-based Gateway Target.

Extends: [GatewayTargetCommonProps](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-bedrock-agentcore-alpha.GatewayTargetCommonProps.html)
Used as argument in: [GatewayTarget.forApiGateway](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-bedrock-agentcore-alpha.GatewayTarget.html#forapigateway)

- Source: [`lib/gateway/targets/target.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/@aws-cdk/aws-bedrock-agentcore-alpha/lib/gateway/targets/target.ts#L187)

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as bedrock_agentcore_alpha from '@aws-cdk/aws-bedrock-agentcore-alpha';
import { aws_apigateway as apigateway } from 'aws-cdk-lib';

declare const credentialProviderConfig: bedrock_agentcore_alpha.ICredentialProviderConfig;
declare const gateway: bedrock_agentcore_alpha.Gateway;
declare const restApi: apigateway.RestApi;
const gatewayTargetApiGatewayProps: bedrock_agentcore_alpha.GatewayTargetApiGatewayProps = {
  apiGatewayToolConfiguration: {
    toolFilters: [{
      filterPath: 'filterPath',
      methods: [bedrock_agentcore_alpha.ApiGatewayHttpMethod.GET],
    }],

    // the properties below are optional
    toolOverrides: [{
      method: bedrock_agentcore_alpha.ApiGatewayHttpMethod.GET,
      name: 'name',
      path: 'path',

      // the properties below are optional
      description: 'description',
    }],
  },
  gateway: gateway,
  restApi: restApi,

  // the properties below are optional
  credentialProviderConfigurations: [credentialProviderConfig],
  description: 'description',
  gatewayTargetName: 'gatewayTargetName',
  metadataConfiguration: {
    allowedQueryParameters: ['allowedQueryParameters'],
    allowedRequestHeaders: ['allowedRequestHeaders'],
    allowedResponseHeaders: ['allowedResponseHeaders'],
  },
  stage: 'stage',
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_bedrock_agentcore_alpha as bedrock_agentcore_alpha
from aws_cdk import aws_apigateway as apigateway

# credential_provider_config: bedrock_agentcore_alpha.ICredentialProviderConfig
# gateway: bedrock_agentcore_alpha.Gateway
# rest_api: apigateway.RestApi

gateway_target_api_gateway_props = bedrock_agentcore_alpha.GatewayTargetApiGatewayProps(
    api_gateway_tool_configuration=bedrock_agentcore_alpha.ApiGatewayToolConfiguration(
        tool_filters=[bedrock_agentcore_alpha.ApiGatewayToolFilter(
            filter_path="filterPath",
            methods=[bedrock_agentcore_alpha.ApiGatewayHttpMethod.GET]
        )],

        # the properties below are optional
        tool_overrides=[bedrock_agentcore_alpha.ApiGatewayToolOverride(
            method=bedrock_agentcore_alpha.ApiGatewayHttpMethod.GET,
            name="name",
            path="path",

            # the properties below are optional
            description="description"
        )]
    ),
    gateway=gateway,
    rest_api=rest_api,

    # the properties below are optional
    credential_provider_configurations=[credential_provider_config],
    description="description",
    gateway_target_name="gatewayTargetName",
    metadata_configuration=bedrock_agentcore_alpha.MetadataConfiguration(
        allowed_query_parameters=["allowedQueryParameters"],
        allowed_request_headers=["allowedRequestHeaders"],
        allowed_response_headers=["allowedResponseHeaders"]
    ),
    stage="stage"
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.bedrock.agentcore.alpha.*;
import software.amazon.awscdk.services.apigateway.*;

ICredentialProviderConfig credentialProviderConfig;
Gateway gateway;
RestApi restApi;

GatewayTargetApiGatewayProps gatewayTargetApiGatewayProps = GatewayTargetApiGatewayProps.builder()
        .apiGatewayToolConfiguration(ApiGatewayToolConfiguration.builder()
                .toolFilters(List.of(ApiGatewayToolFilter.builder()
                        .filterPath("filterPath")
                        .methods(List.of(ApiGatewayHttpMethod.GET))
                        .build()))

                // the properties below are optional
                .toolOverrides(List.of(ApiGatewayToolOverride.builder()
                        .method(ApiGatewayHttpMethod.GET)
                        .name("name")
                        .path("path")

                        // the properties below are optional
                        .description("description")
                        .build()))
                .build())
        .gateway(gateway)
        .restApi(restApi)

        // the properties below are optional
        .credentialProviderConfigurations(List.of(credentialProviderConfig))
        .description("description")
        .gatewayTargetName("gatewayTargetName")
        .metadataConfiguration(MetadataConfiguration.builder()
                .allowedQueryParameters(List.of("allowedQueryParameters"))
                .allowedRequestHeaders(List.of("allowedRequestHeaders"))
                .allowedResponseHeaders(List.of("allowedResponseHeaders"))
                .build())
        .stage("stage")
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.AWS.Bedrock.Agentcore.Alpha
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Bedrock.Agentcore.Alpha;
using Amazon.CDK.AWS.APIGateway;

ICredentialProviderConfig credentialProviderConfig;
Gateway gateway;
RestApi restApi;

var gatewayTargetApiGatewayProps = new GatewayTargetApiGatewayProps {
    ApiGatewayToolConfiguration = new ApiGatewayToolConfiguration {
        ToolFilters = new [] { new ApiGatewayToolFilter {
            FilterPath = "filterPath",
            Methods = new [] { ApiGatewayHttpMethod.GET }
        } },

        // the properties below are optional
        ToolOverrides = new [] { new ApiGatewayToolOverride {
            Method = ApiGatewayHttpMethod.GET,
            Name = "name",
            Path = "path",

            // the properties below are optional
            Description = "description"
        } }
    },
    Gateway = gateway,
    RestApi = restApi,

    // the properties below are optional
    CredentialProviderConfigurations = new [] { credentialProviderConfig },
    Description = "description",
    GatewayTargetName = "gatewayTargetName",
    MetadataConfiguration = new MetadataConfiguration {
        AllowedQueryParameters = new [] { "allowedQueryParameters" },
        AllowedRequestHeaders = new [] { "allowedRequestHeaders" },
        AllowedResponseHeaders = new [] { "allowedResponseHeaders" }
    },
    Stage = "stage"
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awsbedrockagentcorealpha/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awsbedrockagentcorealpha"
import "github.com/aws/aws-cdk-go/awscdk"

var credentialProviderConfig ICredentialProviderConfig
var gateway Gateway
var restApi RestApi

gatewayTargetApiGatewayProps := &GatewayTargetApiGatewayProps{
	ApiGatewayToolConfiguration: &ApiGatewayToolConfiguration{
		ToolFilters: []ApiGatewayToolFilter{
			&ApiGatewayToolFilter{
				FilterPath: jsii.String("filterPath"),
				Methods: []ApiGatewayHttpMethod{
					bedrock_agentcore_alpha.ApiGatewayHttpMethod_GET,
				},
			},
		},

		// the properties below are optional
		ToolOverrides: []ApiGatewayToolOverride{
			&ApiGatewayToolOverride{
				Method: bedrock_agentcore_alpha.ApiGatewayHttpMethod_GET,
				Name: jsii.String("name"),
				Path: jsii.String("path"),

				// the properties below are optional
				Description: jsii.String("description"),
			},
		},
	},
	Gateway: gateway,
	RestApi: restApi,

	// the properties below are optional
	CredentialProviderConfigurations: []ICredentialProviderConfig{
		credentialProviderConfig,
	},
	Description: jsii.String("description"),
	GatewayTargetName: jsii.String("gatewayTargetName"),
	MetadataConfiguration: &MetadataConfiguration{
		AllowedQueryParameters: []*string{
			jsii.String("allowedQueryParameters"),
		},
		AllowedRequestHeaders: []*string{
			jsii.String("allowedRequestHeaders"),
		},
		AllowedResponseHeaders: []*string{
			jsii.String("allowedResponseHeaders"),
		},
	},
	Stage: jsii.String("stage"),
}
```

## Properties

- `apiGatewayToolConfiguration`: [ApiGatewayToolConfiguration](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-bedrock-agentcore-alpha.ApiGatewayToolConfiguration.html) (required) — Tool configuration defining which operations to expose.

- `credentialProviderConfigurations`: [ICredentialProviderConfig](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-bedrock-agentcore-alpha.ICredentialProviderConfig.html)[] — Credential providers for authentication API Gateway targets support IAM and API key authentication.

  **Default:** Empty array (service handles IAM automatically)

- `description`: string — Optional description for the gateway target The description can have up to 200 characters.

  **Default:** No description

- `gateway`: [IGateway](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-bedrock-agentcore-alpha.IGateway.html) (required) — The gateway this target belongs to [disable-awslint:prefer-ref-interface].

- `gatewayTargetName`: string — The name of the gateway target The name must be unique within the gateway Pattern: ^([0-9a-zA-Z][-]?){1,100}$.

  **Default:** auto generate

- `metadataConfiguration`: [MetadataConfiguration](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-bedrock-agentcore-alpha.MetadataConfiguration.html) — Metadata configuration for passing headers and query parameters Allows you to pass additional context through headers and query parameters.

  **Default:** No metadata configuration

- `restApi`: [IRestApi](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.IRestApi.html) (required) — The REST API to integrate with Must be in the same account and region as the gateway [disable-awslint:prefer-ref-interface].

- `stage`: string — The stage name of the REST API.

  **Default:** Uses the deployment stage from the RestApi (restApi.deploymentStage.stageName)
