create_gateway
¶
create_gateway(
name: String,
infrastructure_role_arn: String,
configuration: GatewayConfiguration,
*,
config_overrides: Optional[ECSClientConfig] = 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.
>>> 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/ecs.py
4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 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 | |