hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.77k stars 9.12k forks source link

[Enhancement]: Add support for GameLift Fleet VPC Peering relationships #35899

Open belthesar opened 7 months ago

belthesar commented 7 months ago

Description

AWS GameLift fleets can be peered with other VPCs to grant direct access to resources in other VPCs, such as web servers and other backend services. Currently, the Terraform provider does not expose options for configuring these resources.

The workflow for creating or managing a VPC peering relationship does require some dependency management. To create a VPC peering relationship between a GameLift Fleet and a VPC, the VPC must exist, and a VPC peering authorization must be created prior to creating a VPC peering connection.

VPC peering authorizations valid for 24 hours, and are created from the AWS account where the VPC lives. Once the authorization has been granted successfully, a new or existing GameLift Fleet can then be created or updated with the VPC peering connection in the AWS account where the GameLift Fleet exists.

Support for the methods required to create Fleets with VPC peering connections, and for creating VPC peering authorizations is supported in the current aws_sdk_for_go_v2.

Affected Resource(s) and/or Data Source(s)

Potential Terraform Configuration

resource "aws_gamelift_fleet" "example" {
  build_id                = aws_gamelift_build.example.id
  ec2_instance_type       = "t2.micro"
  fleet_type              = "ON_DEMAND"
  name                    = "example-fleet-name"
  vpc_peer_aws_account_id = data.aws_caller_identity.current.account_id
  vpc_peer_id             = aws_gamelift_backend_vpc.id

  runtime_configuration {
    server_process {
      concurrent_executions = 1
      launch_path           = "C:\\game\\GomokuServer.exe"
    }
  }
}

References

GameLift VPC Peering documentation: https://docs.aws.amazon.com/gamelift/latest/developerguide/vpc-peering.html#vpc-peering-existing API Docs: Create VPC Peering Authorization: https://docs.aws.amazon.com/gamelift/latest/apireference/API_CreateVpcPeeringAuthorization.html API Docs: Create VPC Peering Connection: https://docs.aws.amazon.com/gamelift/latest/apireference/API_CreateVpcPeeringConnection.html API Docs: Delete VPC Peering Authorization: https://docs.aws.amazon.com/gamelift/latest/apireference/API_DeleteVpcPeeringAuthorization.html API Docs: Delete VPC Peering Connection: https://docs.aws.amazon.com/gamelift/latest/apireference/API_DeleteVpcPeeringConnection.html aws_sdk_for_go_v2 documentation showing support for the API requests: https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/service/gamelift#CreateFleetInput

Would you like to implement a fix?

None

github-actions[bot] commented 7 months ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

belthesar commented 7 months ago

I did not respond as to whether I would be willing to implement a fix for this myself, as I am largely unfamiliar with go and writing/updating Terraform providers, however I am exploring the possibility of providing this fix myself.