create_gateway
async
¶
create_gateway(
name: String,
infrastructure_role_arn: String,
configuration: GatewayConfiguration,
*,
config_overrides: Optional[AsyncECSClientConfig] = None,
client_token: Optional[String] = None,
deletion_protection: Optional[BoxedBoolean] = None,
tags: Optional[Tags] = None,
propagate_tags: Optional[PropagateGatewayTags] = None,
) -> CreateGatewayResponse
Creates a gateway. A gateway defines and dynamically manages ingress paths for your Amazon ECS services, handling traffic routing and infrastructure across multiple services while optimizing infrastructure usage. CreateGateway is a synchronous operation and the gateway is returned with a status of ACTIVE. The load balancers and other infrastructure that a gateway manages aren't created until a service in an associated cluster begins using the gateway.
To use this operation, you must have the iam:PassRole permission for the infrastructure role that you specify in infrastructureRoleArn.
Parameters:
-
name(String) –The name for the gateway. The name must be unique within your account and can be up to 255 characters.
-
infrastructure_role_arn(String) –The Amazon Resource Name (ARN) of the IAM role that the gateway assumes to create and manage infrastructure on your behalf.
-
client_token(Optional[String], default:None) –A unique, case-sensitive identifier that you provide to ensure that the operation completes no more than one time. If this token matches a previous request, the service ignores the request, but does not return an error.
-
deletion_protection(Optional[BoxedBoolean], default:None) –Specifies whether to enable deletion protection for the gateway. When enabled, the gateway can't be deleted, and the gateway propagates this setting to the load balancers it manages. The default is
true. -
configuration(GatewayConfiguration) –The type-specific configuration for the gateway. Exactly one configuration variant must be set, and it determines the gateway type. For example,
hostSharedAlbconfigures a gateway that uses Application Load Balancers with host-based routing. -
tags(Optional[Tags], default:None) –The metadata that you apply to the gateway to help you categorize and organize it. Each tag consists of a key and an optional value. Depending on
propagateTags, these tags can be applied to the infrastructure the gateway manages. -
propagate_tags(Optional[PropagateGatewayTags], default:None) –Specifies whether to propagate the tags from the gateway to the infrastructure that the gateway manages. The default is
GATEWAY.
Raises:
-
AccessDeniedException–You don't have authorization to perform the requested action.
-
ClientException–These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.
-
InvalidParameterException–The specified parameter isn't valid. Review the available parameters for the API request.
For more information about service event errors, see Amazon ECS service event messages.
-
ServerException–These errors are usually caused by a server issue.
-
UnsupportedFeatureException–The specified task isn't supported in this Region.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To create a gateway This example creates a gateway named my-gateway that uses internet-facing Application Load Balancers with host-based routing in the specified subnets.
>>> await client.create_gateway(name='my-gateway', infrastructure_role_arn='arn:aws:iam::123456789012:role/ecsInfrastructureRole', configuration={'hostSharedAlb': {'networkConfiguration': {'subnets': ['subnet-0123456789abcdef0', 'subnet-0fedcba9876543210'], 'ipAddressType': 'ipv4'}, 'scheme': 'internet-facing', 'protocol': 'HTTPS', 'port': 443, 'maxAlbCount': 10, 'httpDesync': 'defensive'}}, tags=[{'key': 'team', 'value': 'web'}], propagate_tags='GATEWAY')
Source code in docs_src/capo_ecs/_services/async_ecs.py
4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 | |