GameLift / Client / create_vpc_peering_authorization

create_vpc_peering_authorization#

GameLift.Client.create_vpc_peering_authorization(**kwargs)#

Requests authorization to create or delete a peer connection between the VPC for your Amazon GameLift fleet and a virtual private cloud (VPC) in your Amazon Web Services account. VPC peering enables the game servers on your fleet to communicate directly with other Amazon Web Services resources. After you’ve received authorization, use CreateVpcPeeringConnection to establish the peering connection. For more information, see VPC Peering with Amazon GameLift Fleets.

You can peer with VPCs that are owned by any Amazon Web Services account you have access to, including the account that you use to manage your Amazon GameLift fleets. You cannot peer with VPCs that are in different Regions.

To request authorization to create a connection, call this operation from the Amazon Web Services account with the VPC that you want to peer to your Amazon GameLift fleet. For example, to enable your game servers to retrieve data from a DynamoDB table, use the account that manages that DynamoDB resource. Identify the following values: (1) The ID of the VPC that you want to peer with, and (2) the ID of the Amazon Web Services account that you use to manage Amazon GameLift. If successful, VPC peering is authorized for the specified VPC.

To request authorization to delete a connection, call this operation from the Amazon Web Services account with the VPC that is peered with your Amazon GameLift fleet. Identify the following values: (1) VPC ID that you want to delete the peering connection for, and (2) ID of the Amazon Web Services account that you use to manage Amazon GameLift.

The authorization remains valid for 24 hours unless it is canceled. You must create or delete the peering connection while the authorization is valid.

Related actions

All APIs by task

See also: AWS API Documentation

Request Syntax

response = client.create_vpc_peering_authorization(
    GameLiftAwsAccountId='string',
    PeerVpcId='string'
)
Parameters:
  • GameLiftAwsAccountId (string) –

    [REQUIRED]

    A unique identifier for the Amazon Web Services account that you use to manage your Amazon GameLift fleet. You can find your Account ID in the Amazon Web Services Management Console under account settings.

  • PeerVpcId (string) –

    [REQUIRED]

    A unique identifier for a VPC with resources to be accessed by your Amazon GameLift fleet. The VPC must be in the same Region as your fleet. To look up a VPC ID, use the VPC Dashboard in the Amazon Web Services Management Console. Learn more about VPC peering in VPC Peering with Amazon GameLift Fleets.

Return type:

dict

Returns:

Response Syntax

{
    'VpcPeeringAuthorization': {
        'GameLiftAwsAccountId': 'string',
        'PeerVpcAwsAccountId': 'string',
        'PeerVpcId': 'string',
        'CreationTime': datetime(2015, 1, 1),
        'ExpirationTime': datetime(2015, 1, 1)
    }
}

Response Structure

  • (dict) –

    • VpcPeeringAuthorization (dict) –

      Details on the requested VPC peering authorization, including expiration.

      • GameLiftAwsAccountId (string) –

        A unique identifier for the Amazon Web Services account that you use to manage your Amazon GameLift fleet. You can find your Account ID in the Amazon Web Services Management Console under account settings.

      • PeerVpcAwsAccountId (string) –

        The authorization’s peer VPC Amazon Web Services account ID.

      • PeerVpcId (string) –

        A unique identifier for a VPC with resources to be accessed by your Amazon GameLift fleet. The VPC must be in the same Region as your fleet. To look up a VPC ID, use the VPC Dashboard in the Amazon Web Services Management Console. Learn more about VPC peering in VPC Peering with Amazon GameLift Fleets.

      • CreationTime (datetime) –

        Time stamp indicating when this authorization was issued. Format is a number expressed in Unix time as milliseconds (for example "1469498468.057").

      • ExpirationTime (datetime) –

        Time stamp indicating when this authorization expires (24 hours after issuance). Format is a number expressed in Unix time as milliseconds (for example "1469498468.057").

Exceptions

  • GameLift.Client.exceptions.UnauthorizedException

  • GameLift.Client.exceptions.InvalidRequestException

  • GameLift.Client.exceptions.NotFoundException

  • GameLift.Client.exceptions.InternalServiceException