Documentation ¶
Index ¶
- Constants
- Variables
- func AlphanumericFormatFunc(s string) string
- func GetAvailabilityZone(location commonpb.Location, az int, cloud commonpb.CloudProvider) (string, error)
- func GetCloudLocation(location commonpb.Location, provider commonpb.CloudProvider) (string, error)
- func GetVmSize(s commonpb.VmSize_Enum, c commonpb.CloudProvider) (string, error)
- func LowercaseAlphanumericAndDashFormatFunc(s string) string
- func LowercaseAlphanumericFormatFunc(s string) string
- func RandomString(n int) string
- func RemoveSpecialChars(a string) string
- func StringInSlice(a string, list []string) bool
- func UniqueId(prefix string, suffix string, formatFunc FormatFunc) string
- type AwsResource
- type AzResource
- type FormatFunc
- type GcpResource
Constants ¶
View Source
const ( AWS = commonpb.CloudProvider_AWS AZURE = commonpb.CloudProvider_AZURE GCP = commonpb.CloudProvider_GCP )
Variables ¶
View Source
var AMIMAP = map[string]string{
"eu-west-1": "ami-09d4a659cdd8677be",
"eu-west-2": "ami-0fc15d50d39e4503c",
"eu-west-3": "ami-0fc15d50d39e4503c",
"us-east-1": "ami-04ad2567c9e3d7893",
"us-east-2": "ami-04ad2567c9e3d7893",
"us-west-1": "ami-04ad2567c9e3d7893",
"us-west-2": "ami-04ad2567c9e3d7893",
"eu-north-1": "ami-04ad2567c9e3d7893",
}
eu-west-2 "ami-0fc15d50d39e4503c" amzn2-ami-hvm-2.0.20211103.0-x86_64-gp2 https://cloud-images.ubuntu.com/locator/ec2/
View Source
var AVAILABILITY_ZONES = map[commonpb.Location]map[commonpb.CloudProvider][]string{ commonpb.Location_EU_WEST_1: { AWS: []string{"eu-west-1a", "eu-west-1b", "eu-west-1c"}, AZURE: []string{"1", "2", "3"}, GCP: []string{"europe-west1-b", "europe-west1-c", "europe-west1-d"}, }, commonpb.Location_EU_WEST_2: { AWS: []string{"eu-west-2a", "eu-west-2b", "eu-west-2c"}, AZURE: []string{"1", "2", "3"}, GCP: []string{"europe-west2-a", "europe-west2-b", "europe-west2-c"}, }, commonpb.Location_EU_WEST_3: { AWS: []string{"eu-west-3a", "eu-west-3b", "eu-west-3c"}, AZURE: []string{"1", "2", "3"}, GCP: []string{"europe-west3-a", "europe-west3-b", "europe-west3-c"}, }, commonpb.Location_US_EAST_1: { AWS: []string{"us-east-1a", "us-east-1b", "us-east-1c"}, AZURE: []string{"1", "2", "3"}, GCP: []string{"us-east4-a", "us-east4-b", "us-east4-c"}, }, commonpb.Location_US_EAST_2: { AWS: []string{"us-east-2a", "us-east-2b", "us-east-2c"}, AZURE: []string{"1", "2", "3"}, GCP: []string{"us-east5-a", "us-east5-b", "us-east5-c"}, }, commonpb.Location_US_WEST_1: { AWS: []string{"us-west-1a", "us-west-1c"}, AZURE: []string{"1", "2"}, GCP: []string{"us-west2-a", "us-west2-b", "us-west2-c"}, }, commonpb.Location_US_WEST_2: { AWS: []string{"us-west-2a", "us-west-2b", "us-west-2c", "us-west-2d"}, AZURE: []string{"1", "2", "3"}, GCP: []string{"us-west1-a", "us-west1-b", "us-west1-c"}, }, commonpb.Location_EU_NORTH_1: { AWS: []string{"eu-north-1a", "eu-north-1b", "eu-north-1c"}, AZURE: []string{"1", "2", "3"}, GCP: []string{"europe-north1-a", "europe-north1-b", "europe-north1-c"}, }, }
View Source
var AwsAmiOwners = map[resourcespb.ImageReference_OperatingSystemDistribution]string{ resourcespb.ImageReference_UBUNTU: "099720109477", resourcespb.ImageReference_CENT_OS: "125523088429", resourcespb.ImageReference_DEBIAN: "136693071363", }
View Source
var DBSIZE = map[commonpb.DatabaseSize_Enum]map[commonpb.CloudProvider]string{ commonpb.DatabaseSize_MICRO: { commonpb.CloudProvider_AWS: "db.t2.micro", commonpb.CloudProvider_AZURE: "GP_Gen5_2", commonpb.CloudProvider_GCP: "db-f1-micro", }, commonpb.DatabaseSize_SMALL: { commonpb.CloudProvider_AWS: "db.t2.small", commonpb.CloudProvider_AZURE: "GP_Gen5_4", commonpb.CloudProvider_GCP: "db-g1-small", }, commonpb.DatabaseSize_MEDIUM: { commonpb.CloudProvider_AWS: "db.t2.medium", commonpb.CloudProvider_AZURE: "GP_Gen5_6", commonpb.CloudProvider_GCP: "db-n1-standard-1", }, }
View Source
var LOCATION = map[commonpb.Location]map[commonpb.CloudProvider]string{ commonpb.Location_EU_WEST_1: { AWS: "eu-west-1", AZURE: "northeurope", GCP: "europe-west1", }, commonpb.Location_EU_WEST_2: { AWS: "eu-west-2", AZURE: "uksouth", GCP: "europe-west2", }, commonpb.Location_EU_WEST_3: { AWS: "eu-west-3", AZURE: "francecentral", GCP: "europe-west9", }, commonpb.Location_US_EAST_1: { AWS: "us-east-1", AZURE: "eastus", GCP: "us-east4", }, commonpb.Location_US_EAST_2: { AWS: "us-east-2", AZURE: "eastus2", GCP: "us-east5", }, commonpb.Location_US_WEST_1: { AWS: "us-west-1", AZURE: "westus2", GCP: "us-west2", }, commonpb.Location_US_WEST_2: { AWS: "us-west-2", AZURE: "westus3", GCP: "us-west1", }, commonpb.Location_EU_NORTH_1: { AWS: "eu-north-1", AZURE: "swedencentral", GCP: "europe-north1", }, }
View Source
var VMSIZE = map[commonpb.VmSize_Enum]map[commonpb.CloudProvider]string{ commonpb.VmSize_GENERAL_NANO: { commonpb.CloudProvider_AWS: "t2.nano", commonpb.CloudProvider_AZURE: "Standard_B1ls", }, commonpb.VmSize_GENERAL_MICRO: { commonpb.CloudProvider_AWS: "t2.micro", commonpb.CloudProvider_AZURE: "Standard_B1s", commonpb.CloudProvider_GCP: "e2-micro", }, commonpb.VmSize_GENERAL_SMALL: { commonpb.CloudProvider_AWS: "t2.small", commonpb.CloudProvider_AZURE: "Standard_B1ms", commonpb.CloudProvider_GCP: "e2-small", }, commonpb.VmSize_GENERAL_MEDIUM: { commonpb.CloudProvider_AWS: "t2.medium", commonpb.CloudProvider_AZURE: "Standard_B2s", commonpb.CloudProvider_GCP: "e2-medium", }, commonpb.VmSize_GENERAL_LARGE: { commonpb.CloudProvider_AWS: "t2.large", commonpb.CloudProvider_AZURE: "Standard_B2ms", commonpb.CloudProvider_GCP: "e2-standard-2", }, commonpb.VmSize_GENERAL_XLARGE: { commonpb.CloudProvider_AWS: "t2.xlarge", commonpb.CloudProvider_AZURE: "Standard_B4ms", commonpb.CloudProvider_GCP: "e2-standard-4", }, commonpb.VmSize_GENERAL_2XLARGE: { commonpb.CloudProvider_AWS: "t2.2xlarge", commonpb.CloudProvider_AZURE: "Standard_B8ms", commonpb.CloudProvider_GCP: "e2-standard-8", }, commonpb.VmSize_COMPUTE_LARGE: { commonpb.CloudProvider_AWS: "c4.large", commonpb.CloudProvider_AZURE: "Standard_F2s_v2", }, commonpb.VmSize_COMPUTE_XLARGE: { commonpb.CloudProvider_AWS: "c4.xlarge", commonpb.CloudProvider_AZURE: "Standard_F4s_v2", }, commonpb.VmSize_COMPUTE_2XLARGE: { commonpb.CloudProvider_AWS: "c4.2xlarge", commonpb.CloudProvider_AZURE: "Standard_F8s_v2", }, commonpb.VmSize_COMPUTE_4XLARGE: { commonpb.CloudProvider_AWS: "c4.4xlarge", commonpb.CloudProvider_AZURE: "Standard_F16s_v2", }, commonpb.VmSize_COMPUTE_8XLARGE: { commonpb.CloudProvider_AWS: "c4.8xlarge", commonpb.CloudProvider_AZURE: "Standard_F48s_v2", }, commonpb.VmSize_MEMORY_LARGE: { commonpb.CloudProvider_AWS: "r6g.large", commonpb.CloudProvider_AZURE: "Standard_E2s_v3", }, commonpb.VmSize_MEMORY_XLARGE: { commonpb.CloudProvider_AWS: "r6g.xlarge", commonpb.CloudProvider_AZURE: "Standard_E4s_v3", }, commonpb.VmSize_MEMORY_2XLARGE: { commonpb.CloudProvider_AWS: "r6g.2xlarge", commonpb.CloudProvider_AZURE: "Standard_E8s_v3", }, commonpb.VmSize_MEMORY_4XLARGE: { commonpb.CloudProvider_AWS: "r6g.4xlarge", commonpb.CloudProvider_AZURE: "Standard_E16s_v3", }, commonpb.VmSize_MEMORY_8XLARGE: { commonpb.CloudProvider_AWS: "r6g.8xlarge", commonpb.CloudProvider_AZURE: "Standard_E32s_v3", }, commonpb.VmSize_MEMORY_12XLARGE: { commonpb.CloudProvider_AWS: "r6g.12xlarge", commonpb.CloudProvider_AZURE: "Standard_E48s_v3", }, commonpb.VmSize_MEMORY_16XLARGE: { commonpb.CloudProvider_AWS: "r6g.16xlarge", commonpb.CloudProvider_AZURE: "Standard_E64a_v4", }, }
Functions ¶
func AlphanumericFormatFunc ¶
func GetAvailabilityZone ¶
func GetCloudLocation ¶
func GetVmSize ¶ added in v0.1.48
func GetVmSize(s commonpb.VmSize_Enum, c commonpb.CloudProvider) (string, error)
func LowercaseAlphanumericAndDashFormatFunc ¶ added in v0.1.53
func RandomString ¶
func RemoveSpecialChars ¶
func StringInSlice ¶
func UniqueId ¶
func UniqueId(prefix string, suffix string, formatFunc FormatFunc) string
UniqueId generates a stable string composed of prefix+suffix and a 4 char hash. Prefix can be any size but will be sliced if bigger than 16 chars. Suffix can have 4 chars at most. Returns a string with at most 24 chars.
Types ¶
type AwsResource ¶
type AwsResource struct { output.TerraformResource `hcl:",squash"` Tags map[string]string `hcl:"tags" hcle:"omitempty"` }
func NewAwsResource ¶
func NewAwsResource(resourceId string, name string) *AwsResource
func NewAwsResourceWithDeps ¶ added in v0.1.38
func NewAwsResourceWithDeps(resourceId string, name string, deps []string) *AwsResource
func NewAwsResourceWithIdOnly ¶
func NewAwsResourceWithIdOnly(resourceId string) *AwsResource
func (*AwsResource) SetName ¶
func (r *AwsResource) SetName(name string)
type AzResource ¶
type AzResource struct { output.TerraformResource `hcl:",squash"` ResourceGroupName string `hcl:"resource_group_name,expr" hcle:"omitempty"` Name string `hcl:"name" hcle:"omitempty"` Location string `hcl:"location" hcle:"omitempty"` }
func NewAzResource ¶
func NewAzResource(resourceId string, name string, rgName string, location string) *AzResource
func (*AzResource) SetName ¶
func (r *AzResource) SetName(name string)
type FormatFunc ¶
type GcpResource ¶ added in v0.1.46
type GcpResource struct { output.TerraformResource `hcl:",squash"` Name string `hcl:"name" hcle:"omitempty"` Project string `hcl:"project" hcle:"omitempty"` }
func NewGcpResource ¶ added in v0.1.46
func NewGcpResource(resourceId string, name string, project string) *GcpResource
func NewGcpResourceWithNoProject ¶ added in v0.1.53
func NewGcpResourceWithNoProject(resourceId string, name string) *GcpResource
func (*GcpResource) SetName ¶ added in v0.1.46
func (r *GcpResource) SetName(name string)
Click to show internal directories.
Click to hide internal directories.