Documentation
¶
Index ¶
- Variables
- func ResolvedFsStateStorage() *fs.FileSystemStateStorage
- func ResolvedFsStateStorageServerDescriptor() api.ServerDescriptor
- func ResolvedRefappAwsLambdaClientDescriptor() *api.ClientDescriptor
- func ResolvedRefappClientDescriptor(gitRoot string) *api.ClientDescriptor
- func ResolvedRefappCloudClientDescriptor(gitRoot string, desc *api.ClientDescriptor) *api.ClientDescriptor
Constants ¶
This section is empty.
Variables ¶
View Source
var CommonGcpCredentials = gcpApi.Credentials{ Credentials: api.Credentials{ Credentials: "${auth:gcloud}", }, ServiceAccountConfig: gcpApi.ServiceAccountConfig{ ProjectId: "${auth:gcloud.projectId}", }, }
View Source
var CommonKubernetesCredentials = k8s.KubernetesConfig{
Kubeconfig: "${auth:kubernetes}",
}
View Source
var CommonSecretsDescriptor = &api.SecretsDescriptor{ SchemaVersion: api.SecretsSchemaVersion, Auth: map[string]api.AuthDescriptor{ "gcloud": { Type: gcpApi.AuthTypeGCPServiceAccount, Config: api.Config{Config: &gcpApi.Credentials{ Credentials: api.Credentials{ Credentials: "<gcloud-service-account-email>", }, ServiceAccountConfig: gcpApi.ServiceAccountConfig{ ProjectId: "test-gcp-project", }, }}, }, "aws": { Type: "aws-token", Config: api.Config{Config: &awsTokenAuthConfig}, }, "pulumi": { Type: pulumi.AuthTypePulumiToken, Config: api.Config{Config: &pulumi.TokenAuthDescriptor{ Credentials: "<pulumi-token>", }}, }, "kubernetes": { Type: k8s.AuthTypeKubeconfig, Config: api.Config{Config: &k8s.KubernetesConfig{ Kubeconfig: "<kube-config>", }}, }, }, Values: map[string]string{ "CLOUDFLARE_API_TOKEN": "<encrypted-secret>", "GITHUB_TOKEN": "<encrypted-secret>", "MONGODB_ATLAS_PRIVATE_KEY": "<encrypted-secret>", "MONGODB_ATLAS_PUBLIC_KEY": "<encrypted-secret>", "JWT_SECRET": "<encrypted-secret>", "docker-registry-password": "test-pass", "docker-registry-username": "test-user", }, }
View Source
var CommonServerDescriptor = &api.ServerDescriptor{ SchemaVersion: api.ServerSchemaVersion, Provisioner: api.ProvisionerDescriptor{ Type: pulumi.ProvisionerTypePulumi, Config: api.Config{Config: &pulumi.ProvisionerConfig{ StateStorage: pulumi.StateStorageConfig{ Type: pulumi.StateStorageTypeGcpBucket, Config: api.Config{Config: &gcpApi.StateStorageConfig{ Credentials: CommonGcpCredentials, Provision: true, }}, }, SecretsProvider: pulumi.SecretsProviderConfig{ Type: pulumi.SecretsProviderTypeGcpKms, Config: api.Config{Config: &gcpApi.SecretsProviderConfig{ Credentials: CommonGcpCredentials, Provision: true, KeyName: "mypulumi-base-kms-key", KeyLocation: "global", }}, }, }}, }, CiCd: api.CiCdDescriptor{ Type: "github-actions", Config: api.Config{Config: &github.GitHubActionsCiCdConfig{ Organization: "simple-container-org", Environments: map[string]github.GitHubEnvironmentConfig{ "staging": { Type: "staging", Runner: "", Protection: false, Reviewers: nil, Secrets: nil, Variables: nil, DeployFlags: nil, AutoDeploy: false, }, "production": { Type: "production", Runner: "", Protection: false, Reviewers: nil, Secrets: nil, Variables: nil, DeployFlags: nil, AutoDeploy: false, }, }, Notifications: github.GitHubNotificationConfig{ Slack: github.SlackNotificationConfig{ WebhookURL: "", Enabled: false, }, Discord: github.DiscordNotificationConfig{ WebhookURL: "", Enabled: false, }, Telegram: github.TelegramNotificationConfig{ BotToken: "", ChatID: "", Enabled: false, }, }, WorkflowGeneration: github.GitHubWorkflowConfig{ Enabled: false, OutputPath: "", Templates: []string{"deploy", "destroy"}, AutoUpdate: false, CustomActions: map[string]string{}, SCVersion: "", }, }}, }, Secrets: api.SecretsConfigDescriptor{ Type: gcpApi.SecretsTypeGCPSecretsManager, Config: api.Config{Config: &gcpApi.SecretsProviderConfig{ Credentials: gcpApi.Credentials{ Credentials: api.Credentials{ Credentials: "${auth:gcloud}", }, ServiceAccountConfig: gcpApi.ServiceAccountConfig{ ProjectId: "${auth:gcloud.projectId}", }, }, }}, }, Templates: map[string]api.StackDescriptor{ "stack-per-app-aws": { Type: "ecs-fargate", Config: api.Config{Config: &awsEcsFargateTemplateConfig}, }, "stack-per-app": { Type: gcpApi.TemplateTypeGcpCloudrun, Config: api.Config{Config: &gcpApi.TemplateConfig{ Credentials: gcpApi.Credentials{ Credentials: api.Credentials{ Credentials: "${auth:gcloud}", }, ServiceAccountConfig: gcpApi.ServiceAccountConfig{ ProjectId: "${auth:gcloud.projectId}", }, }, }}, }, }, Resources: api.PerStackResourcesDescriptor{ Registrar: api.RegistrarDescriptor{ Type: "cloudflare", Config: api.Config{Config: &api.PluginFieldConfig{ TypeName: "cloudflare", Credentials: "${secret:CLOUDFLARE_API_TOKEN}", Raw: map[string]any{ "credentials": "${secret:CLOUDFLARE_API_TOKEN}", "accountId": 12345, "zoneName": "sc-refapp.org", "dnsRecords": []any{ map[string]any{ "name": "@", "type": "TXT", "value": "MS=ms83691649", }, }, }, }}, }, }, }
View Source
var CommonStack = api.Stack{ Name: "common", Secrets: *CommonSecretsDescriptor, Server: *CommonServerDescriptor, }
View Source
var RefappAwsClientDescriptor = &api.ClientDescriptor{ SchemaVersion: api.ClientSchemaVersion, Stacks: map[string]api.StackClientDescriptor{ "staging": { Type: api.ClientTypeCloudCompose, ParentStack: "refapp-aws", Config: api.Config{ Config: RefappClientComposeConfigStaging, }, }, "prod": { Type: api.ClientTypeCloudCompose, ParentStack: "refapp-aws", Config: api.Config{ Config: RefappClientComposeConfigProd, }, }, }, }
View Source
var RefappAwsLambdaClientDescriptor = &api.ClientDescriptor{ SchemaVersion: api.ClientSchemaVersion, Stacks: map[string]api.StackClientDescriptor{ "staging": { Type: api.ClientTypeSingleImage, ParentStack: "refapp-aws-lambda", Config: api.Config{ Config: &api.StackConfigSingleImage{ Domain: "staging.sc-refapp.org", Image: &api.ContainerImage{ Dockerfile: "Dockerfile", }, Env: map[string]string{ "ENV": "staging", }, }, }, }, "prod": { Type: api.ClientTypeSingleImage, ParentStack: "refapp-aws-lambda", Config: api.Config{ Config: &api.StackConfigSingleImage{ Domain: "prod.sc-refapp.org", Image: &api.ContainerImage{ Dockerfile: "Dockerfile", }, Env: map[string]string{ "ENV": "prod", }, }, }, }, }, }
View Source
var RefappAwsLambdaServerDescriptor = &api.ServerDescriptor{ SchemaVersion: api.ServerSchemaVersion, Provisioner: api.ProvisionerDescriptor{ Inherit: api.Inherit{Inherit: "common"}, }, Secrets: api.SecretsConfigDescriptor{ Inherit: api.Inherit{Inherit: "common"}, }, CiCd: api.CiCdDescriptor{ Inherit: api.Inherit{Inherit: "common"}, }, Templates: map[string]api.StackDescriptor{ "lambda-per-app": { Type: "aws-lambda", Config: api.Config{Config: &awsLambdaTemplateConfig}, }, }, Resources: api.PerStackResourcesDescriptor{ Registrar: api.RegistrarDescriptor{ Inherit: api.Inherit{Inherit: "common"}, }, Resources: map[string]api.PerEnvResourcesDescriptor{ "staging": { Template: "lambda-per-app", }, "prod": { Template: "lambda-per-app", }, }, }, }
View Source
var RefappAwsServerDescriptor = &api.ServerDescriptor{ SchemaVersion: api.ServerSchemaVersion, Provisioner: api.ProvisionerDescriptor{ Inherit: api.Inherit{Inherit: "common"}, }, Secrets: api.SecretsConfigDescriptor{ Inherit: api.Inherit{Inherit: "common"}, }, CiCd: api.CiCdDescriptor{ Inherit: api.Inherit{Inherit: "common"}, }, Templates: map[string]api.StackDescriptor{ "stack-per-app-aws": { Inherit: api.Inherit{Inherit: "common"}, }, }, Resources: api.PerStackResourcesDescriptor{ Registrar: api.RegistrarDescriptor{ Inherit: api.Inherit{Inherit: "common"}, }, Resources: map[string]api.PerEnvResourcesDescriptor{ "staging": { Template: "stack-per-app-aws", }, "prod": { Template: "stack-per-app-aws", }, }, }, }
View Source
var RefappAwsStack = api.Stack{ Name: "refapp-aws", Secrets: *CommonSecretsDescriptor, Server: *RefappServerDescriptor, Client: *RefappClientDescriptor, }
View Source
var RefappClientComposeConfigProd = &api.StackConfigCompose{ Domain: "prod.sc-refapp.org", DockerComposeFile: "${git:root}/docker-compose.yaml", Uses: []string{ "mongodb", }, Runs: []string{ "api", "ui", }, Env: map[string]string{}, Secrets: map[string]string{}, Dependencies: []api.StackConfigDependencyResource{}, }
View Source
var RefappClientComposeConfigStaging = &api.StackConfigCompose{ Domain: "staging.sc-refapp.org", DockerComposeFile: "${git:root}/docker-compose.yaml", Uses: []string{ "mongodb", }, Runs: []string{ "api", "ui", }, Env: map[string]string{}, Secrets: map[string]string{}, Dependencies: []api.StackConfigDependencyResource{}, }
View Source
var RefappClientDescriptor = &api.ClientDescriptor{ SchemaVersion: api.ClientSchemaVersion, Defaults: map[string]interface{}{}, Stacks: map[string]api.StackClientDescriptor{ "staging": { Type: api.ClientTypeCloudCompose, ParentStack: "refapp", Config: api.Config{ Config: &api.StackConfigCompose{ Domain: "staging.sc-refapp.org", DockerComposeFile: "${git:root}/docker-compose.yaml", Uses: []string{ "mongodb", }, Runs: []string{ "api", "ui", }, Env: map[string]string{ "JWT_SECRET": "${secret:JWT_SECRET}", "MONGO_URI": "${resource:mongodb.uri}", }, Secrets: map[string]string{}, Dependencies: []api.StackConfigDependencyResource{}, }, }, }, "prod": { Type: api.ClientTypeCloudCompose, ParentStack: "refapp", Config: api.Config{ Config: &api.StackConfigCompose{ Domain: "prod.sc-refapp.org", DockerComposeFile: "${git:root}/docker-compose.yaml", Uses: []string{ "mongodb", }, Runs: []string{ "api", "ui", }, Env: map[string]string{ "JWT_SECRET": "${secret:JWT_SECRET}", "MONGO_URI": "${resource:mongodb.uri}", }, Secrets: map[string]string{}, Dependencies: []api.StackConfigDependencyResource{}, }, }, }, }, }
View Source
var RefappGkeAutopilotClientDescriptor = &api.ClientDescriptor{ SchemaVersion: api.ClientSchemaVersion, Stacks: map[string]api.StackClientDescriptor{ "staging": { Type: api.ClientTypeCloudCompose, ParentStack: "refapp-gke-autopilot", Config: api.Config{ Config: RefappClientComposeConfigStaging, }, }, "prod": { Type: api.ClientTypeCloudCompose, ParentStack: "refapp-gke-autopilot", Config: api.Config{ Config: RefappClientComposeConfigProd, }, }, }, }
View Source
var RefappGkeAutopilotServerDescriptor = &api.ServerDescriptor{ SchemaVersion: api.ServerSchemaVersion, Provisioner: api.ProvisionerDescriptor{ Inherit: api.Inherit{Inherit: "common"}, }, Secrets: api.SecretsConfigDescriptor{ Inherit: api.Inherit{Inherit: "common"}, }, CiCd: api.CiCdDescriptor{ Inherit: api.Inherit{Inherit: "common"}, }, Templates: map[string]api.StackDescriptor{ "stack-per-app-gke": { Type: "gcp-gke-autopilot", Config: api.Config{ Config: &gcpApi.GkeAutopilotTemplate{ Credentials: CommonGcpCredentials, GkeClusterResource: "gke-autopilot-res", ArtifactRegistryResource: "artifact-registry-res", }, }, Inherit: api.Inherit{}, }, }, Resources: api.PerStackResourcesDescriptor{ Registrar: api.RegistrarDescriptor{ Inherit: api.Inherit{Inherit: "common"}, }, Resources: map[string]api.PerEnvResourcesDescriptor{ "staging": { Template: "stack-per-app-gke", Resources: RefappGkeAutopilotServerResources, }, "prod": { Template: "stack-per-app-gke", Resources: RefappGkeAutopilotServerResources, }, }, }, }
View Source
var RefappGkeAutopilotServerResources = map[string]api.ResourceDescriptor{ "gke-autopilot-res": { Type: "gcp-gke-autopilot-cluster", Config: api.Config{ Config: &gcpApi.GkeAutopilotResource{ Credentials: CommonGcpCredentials, GkeMinVersion: "1.33.4-gke.1245000", Location: "europe-west3", }, }, Inherit: api.Inherit{}, }, "artifact-registry-res": { Type: "gcp-artifact-registry", Config: api.Config{ Config: &gcpApi.ArtifactRegistryConfig{ Credentials: CommonGcpCredentials, Location: "europe-west3", }, }, Inherit: api.Inherit{}, }, }
View Source
var RefappKubernetesClientDescriptor = &api.ClientDescriptor{ SchemaVersion: api.ClientSchemaVersion, Stacks: map[string]api.StackClientDescriptor{ "staging": { Type: api.ClientTypeCloudCompose, ParentStack: "refapp-kubernetes", Config: api.Config{ Config: RefappClientComposeConfigStaging, }, }, "prod": { Type: api.ClientTypeCloudCompose, ParentStack: "refapp-kubernetes", Config: api.Config{ Config: RefappClientComposeConfigProd, }, }, }, }
View Source
var RefappKubernetesServerDescriptor = &api.ServerDescriptor{ SchemaVersion: api.ServerSchemaVersion, Provisioner: api.ProvisionerDescriptor{ Inherit: api.Inherit{Inherit: "common"}, }, Secrets: api.SecretsConfigDescriptor{ Inherit: api.Inherit{Inherit: "common"}, }, CiCd: api.CiCdDescriptor{ Inherit: api.Inherit{Inherit: "common"}, }, Templates: map[string]api.StackDescriptor{ "stack-per-app-k8s": { Type: k8s.TemplateTypeKubernetesCloudrun, Config: api.Config{ Config: &k8s.CloudrunTemplate{ KubernetesConfig: k8s.KubernetesConfig{ Kubeconfig: "${auth:kubernetes}", }, RegistryCredentials: docker.RegistryCredentials{ DockerRegistryURL: lo.ToPtr("index.docker.io"), DockerRegistryUsername: lo.ToPtr("${secret:docker-registry-username}"), DockerRegistryPassword: lo.ToPtr("${secret:docker-registry-password}"), }, CaddyResource: lo.ToPtr("caddy"), }, }, Inherit: api.Inherit{}, }, }, Resources: api.PerStackResourcesDescriptor{ Registrar: api.RegistrarDescriptor{ Inherit: api.Inherit{Inherit: "common"}, }, Resources: map[string]api.PerEnvResourcesDescriptor{ "staging": { Template: "stack-per-app-k8s", Resources: RefappKubernetesServerResources, }, }, }, }
View Source
var RefappKubernetesServerResources = map[string]api.ResourceDescriptor{ "caddy": { Type: k8s.ResourceTypeCaddy, Config: api.Config{Config: &k8s.CaddyResource{ KubernetesConfig: &k8s.KubernetesConfig{ Kubeconfig: "${auth:kubernetes}", }, CaddyConfig: &k8s.CaddyConfig{ Enable: lo.ToPtr(true), Namespace: lo.ToPtr("caddy"), Replicas: lo.ToPtr(2), }, }}, }, }
View Source
var RefappServerDescriptor = &api.ServerDescriptor{ SchemaVersion: api.ServerSchemaVersion, Provisioner: api.ProvisionerDescriptor{ Inherit: api.Inherit{Inherit: "common"}, }, Secrets: api.SecretsConfigDescriptor{ Inherit: api.Inherit{Inherit: "common"}, }, CiCd: api.CiCdDescriptor{ Inherit: api.Inherit{Inherit: "common"}, }, Templates: map[string]api.StackDescriptor{ "stack-per-app": { Inherit: api.Inherit{Inherit: "common"}, }, }, Variables: map[string]api.VariableDescriptor{ "atlas-region": { Type: "string", Value: "US_SOUTH_1", }, "atlas-project-id": { Type: "string", Value: "5b89110a4e6581562623c59c", }, "atlas-org-id": { Type: "string", Value: "5b89110a4e6581562623c59c", }, "atlas-instance-size": { Type: "string", Value: "M10", }, }, Resources: api.PerStackResourcesDescriptor{ Registrar: api.RegistrarDescriptor{ Inherit: api.Inherit{Inherit: "common"}, }, Resources: map[string]api.PerEnvResourcesDescriptor{ "staging": { Template: "stack-per-app", Resources: map[string]api.ResourceDescriptor{ "mongodb": mongodbAtlasResourceConfig, "postgres": { Type: gcpApi.ResourceTypePostgresGcpCloudsql, Config: api.Config{Config: &gcpApi.PostgresGcpCloudsqlConfig{ Version: "14.5", Project: "${stack:name}", Credentials: gcpApi.Credentials{ Credentials: api.Credentials{ Credentials: "${auth:gcloud}", }, ServiceAccountConfig: gcpApi.ServiceAccountConfig{ ProjectId: "${auth:gcloud.projectId}", }, }, }}, }, }, }, "prod": { Template: "stack-per-app", Resources: map[string]api.ResourceDescriptor{ "mongodb": mongodbAtlasResourceConfig, "postgres": { Type: "gcp-cloudsql-postgres", Config: api.Config{Config: &gcpApi.PostgresGcpCloudsqlConfig{ Version: "14.5", Project: "${stack:name}", Credentials: gcpApi.Credentials{ Credentials: api.Credentials{ Credentials: "${auth:gcloud}", }, ServiceAccountConfig: gcpApi.ServiceAccountConfig{ ProjectId: "${auth:gcloud.projectId}", }, }, }}, }, }, }, }, }, }
View Source
var RefappStack = api.Stack{ Name: "refapp", Secrets: *CommonSecretsDescriptor, Server: *RefappServerDescriptor, Client: *RefappClientDescriptor, }
View Source
var RefappStaticGCPClientDescriptor = &api.ClientDescriptor{ SchemaVersion: api.ClientSchemaVersion, Stacks: map[string]api.StackClientDescriptor{ "staging": { Type: api.ClientTypeStatic, ParentStack: "refapp-static-gcp", Config: api.Config{ Config: &api.StackConfigStatic{ BundleDir: "./bundle", Site: api.StaticSiteConfig{ Domain: "staging.sc-refapp.org", }, }, }, }, "prod": { Type: api.ClientTypeStatic, ParentStack: "refapp-static-gcp", Config: api.Config{ Config: &api.StackConfigStatic{ BundleDir: "./bundle", Site: api.StaticSiteConfig{ Domain: "prod.sc-refapp.org", }, }, }, }, }, }
View Source
var RefappStaticGCPServerDescriptor = &api.ServerDescriptor{ SchemaVersion: api.ServerSchemaVersion, Provisioner: api.ProvisionerDescriptor{ Inherit: api.Inherit{Inherit: "common"}, }, Secrets: api.SecretsConfigDescriptor{ Inherit: api.Inherit{Inherit: "common"}, }, CiCd: api.CiCdDescriptor{ Inherit: api.Inherit{Inherit: "common"}, }, Templates: map[string]api.StackDescriptor{ "static-website": { Type: gcpApi.TemplateTypeStaticWebsite, Config: api.Config{Config: &gcpApi.TemplateConfig{ Credentials: gcpApi.Credentials{ Credentials: api.Credentials{ Credentials: "${auth:gcloud}", }, ServiceAccountConfig: gcpApi.ServiceAccountConfig{ ProjectId: "${auth:gcloud.projectId}", }, }, }}, Inherit: api.Inherit{}, }, }, Resources: api.PerStackResourcesDescriptor{ Registrar: api.RegistrarDescriptor{ Inherit: api.Inherit{Inherit: "common"}, }, Resources: map[string]api.PerEnvResourcesDescriptor{ "staging": { Template: "static-website", }, "prod": { Template: "static-website", }, }, }, }
View Source
var ResolvedCommonGcpCredentials = gcpApi.Credentials{ Credentials: api.Credentials{ Credentials: "<gcloud-service-account-email>", }, ServiceAccountConfig: gcpApi.ServiceAccountConfig{ ProjectId: "test-gcp-project", }, }
View Source
var ResolvedCommonServerDescriptor = &api.ServerDescriptor{ SchemaVersion: api.ServerSchemaVersion, Provisioner: api.ProvisionerDescriptor{ Type: pulumi.ProvisionerTypePulumi, Config: api.Config{Config: &pulumi.ProvisionerConfig{ StateStorage: pulumi.StateStorageConfig{ Type: pulumi.StateStorageTypeGcpBucket, Config: api.Config{Config: &gcpApi.StateStorageConfig{ Credentials: ResolvedCommonGcpCredentials, Provision: true, }}, }, SecretsProvider: pulumi.SecretsProviderConfig{ Type: pulumi.SecretsProviderTypeGcpKms, Config: api.Config{Config: &gcpApi.SecretsProviderConfig{ Credentials: ResolvedCommonGcpCredentials, KeyName: "mypulumi-base-kms-key", KeyLocation: "global", Provision: true, }}, }, }}, }, CiCd: api.CiCdDescriptor{ Type: "github-actions", Config: api.Config{Config: &github.GitHubActionsCiCdConfig{ Organization: "simple-container-org", Environments: map[string]github.GitHubEnvironmentConfig{ "staging": { Type: "staging", Runner: "", Protection: false, Reviewers: nil, Secrets: nil, Variables: nil, DeployFlags: nil, AutoDeploy: false, }, "production": { Type: "production", Runner: "", Protection: false, Reviewers: nil, Secrets: nil, Variables: nil, DeployFlags: nil, AutoDeploy: false, }, }, Notifications: github.GitHubNotificationConfig{ Slack: github.SlackNotificationConfig{ WebhookURL: "", Enabled: false, }, Discord: github.DiscordNotificationConfig{ WebhookURL: "", Enabled: false, }, Telegram: github.TelegramNotificationConfig{ BotToken: "", ChatID: "", Enabled: false, }, }, WorkflowGeneration: github.GitHubWorkflowConfig{ Enabled: false, OutputPath: "", Templates: []string{"deploy", "destroy"}, AutoUpdate: false, CustomActions: map[string]string{}, SCVersion: "", }, }}, }, Secrets: api.SecretsConfigDescriptor{ Type: gcpApi.SecretsTypeGCPSecretsManager, Config: api.Config{Config: &gcpApi.SecretsProviderConfig{ Credentials: ResolvedCommonGcpCredentials, }}, }, Templates: map[string]api.StackDescriptor{ "stack-per-app-aws": { Type: "ecs-fargate", Config: api.Config{Config: &resolvedAwsEcsFargateTemplateConfig}, }, "stack-per-app": { Type: gcpApi.TemplateTypeGcpCloudrun, Config: api.Config{Config: &gcpApi.TemplateConfig{ Credentials: ResolvedCommonGcpCredentials, }}, }, }, Resources: api.PerStackResourcesDescriptor{ Registrar: api.RegistrarDescriptor{ Type: "cloudflare", Config: api.Config{Config: &api.PluginFieldConfig{ TypeName: "cloudflare", Credentials: "<encrypted-secret>", Raw: map[string]any{ "credentials": "<encrypted-secret>", "accountId": 12345, "zoneName": "sc-refapp.org", "dnsRecords": []any{ map[string]any{ "name": "@", "type": "TXT", "value": "MS=ms83691649", }, }, }, }}, }, }, }
View Source
var ResolvedRefappAwsLambdaServerDescriptor = &api.ServerDescriptor{ SchemaVersion: api.ServerSchemaVersion, Provisioner: ResolvedCommonServerDescriptor.Provisioner, Secrets: ResolvedCommonServerDescriptor.Secrets, CiCd: ResolvedCommonServerDescriptor.CiCd, Templates: map[string]api.StackDescriptor{ "lambda-per-app": { Type: "aws-lambda", Config: api.Config{Config: &resolvedAwsLambdaTemplateConfig}, }, }, Resources: api.PerStackResourcesDescriptor{ Registrar: ResolvedCommonServerDescriptor.Resources.Registrar, Resources: map[string]api.PerEnvResourcesDescriptor{ "staging": { Template: "lambda-per-app", }, "prod": { Template: "lambda-per-app", }, }, }, }
View Source
var ResolvedRefappAwsServerDescriptor = &api.ServerDescriptor{ SchemaVersion: api.ServerSchemaVersion, Provisioner: ResolvedCommonServerDescriptor.Provisioner, Secrets: ResolvedCommonServerDescriptor.Secrets, CiCd: ResolvedCommonServerDescriptor.CiCd, Templates: map[string]api.StackDescriptor{ "stack-per-app-aws": ResolvedCommonServerDescriptor.Templates["stack-per-app-aws"], }, Resources: api.PerStackResourcesDescriptor{ Registrar: ResolvedCommonServerDescriptor.Resources.Registrar, Resources: map[string]api.PerEnvResourcesDescriptor{ "staging": { Template: "stack-per-app-aws", }, "prod": { Template: "stack-per-app-aws", }, }, }, }
View Source
var ResolvedRefappGkeAutopilotServerDescriptor = &api.ServerDescriptor{ SchemaVersion: api.ServerSchemaVersion, Provisioner: ResolvedCommonServerDescriptor.Provisioner, Secrets: ResolvedCommonServerDescriptor.Secrets, CiCd: ResolvedCommonServerDescriptor.CiCd, Templates: map[string]api.StackDescriptor{ "stack-per-app-gke": { Type: "gcp-gke-autopilot", Config: api.Config{ Config: &gcpApi.GkeAutopilotTemplate{ Credentials: ResolvedCommonGcpCredentials, ArtifactRegistryResource: "artifact-registry-res", GkeClusterResource: "gke-autopilot-res", }, }, Inherit: api.Inherit{}, }, }, Resources: api.PerStackResourcesDescriptor{ Registrar: ResolvedCommonServerDescriptor.Resources.Registrar, Resources: map[string]api.PerEnvResourcesDescriptor{ "staging": { Template: "stack-per-app-gke", Resources: ResolvedRefappGkeAutopilotServerResources, }, "prod": { Template: "stack-per-app-gke", Resources: ResolvedRefappGkeAutopilotServerResources, }, }, }, }
View Source
var ResolvedRefappGkeAutopilotServerResources = map[string]api.ResourceDescriptor{ "gke-autopilot-res": { Type: "gcp-gke-autopilot-cluster", Config: api.Config{ Config: &gcpApi.GkeAutopilotResource{ Credentials: ResolvedCommonGcpCredentials, GkeMinVersion: "1.33.4-gke.1245000", Location: "europe-west3", }, }, Inherit: api.Inherit{}, }, "artifact-registry-res": { Type: "gcp-artifact-registry", Config: api.Config{ Config: &gcpApi.ArtifactRegistryConfig{ Credentials: ResolvedCommonGcpCredentials, Location: "europe-west3", }, }, Inherit: api.Inherit{}, }, }
View Source
var ResolvedRefappKubernetesServerDescriptor = &api.ServerDescriptor{ SchemaVersion: api.ServerSchemaVersion, Provisioner: ResolvedCommonServerDescriptor.Provisioner, Secrets: ResolvedCommonServerDescriptor.Secrets, CiCd: ResolvedCommonServerDescriptor.CiCd, Templates: map[string]api.StackDescriptor{ "stack-per-app-k8s": { Type: "kubernetes-cloudrun", Config: api.Config{ Config: &k8s.CloudrunTemplate{ KubernetesConfig: k8s.KubernetesConfig{ Kubeconfig: "<kube-config>", }, RegistryCredentials: docker.RegistryCredentials{ DockerRegistryURL: lo.ToPtr("index.docker.io"), DockerRegistryUsername: lo.ToPtr("test-user"), DockerRegistryPassword: lo.ToPtr("test-pass"), }, CaddyResource: lo.ToPtr("caddy"), }, }, Inherit: api.Inherit{}, }, }, Resources: api.PerStackResourcesDescriptor{ Registrar: ResolvedCommonServerDescriptor.Resources.Registrar, Resources: map[string]api.PerEnvResourcesDescriptor{ "staging": { Template: "stack-per-app-k8s", Resources: ResolvedRefappKubernetesServerResources, }, }, }, }
View Source
var ResolvedRefappKubernetesServerResources = map[string]api.ResourceDescriptor{ "caddy": { Type: k8s.ResourceTypeCaddy, Config: api.Config{Config: &k8s.CaddyResource{ KubernetesConfig: &k8s.KubernetesConfig{ Kubeconfig: "<kube-config>", }, CaddyConfig: &k8s.CaddyConfig{ Enable: lo.ToPtr(true), Namespace: lo.ToPtr("caddy"), Replicas: lo.ToPtr(2), }, }}, }, }
View Source
var ResolvedRefappServerDescriptor = &api.ServerDescriptor{ SchemaVersion: api.ServerSchemaVersion, Provisioner: ResolvedCommonServerDescriptor.Provisioner, Secrets: ResolvedCommonServerDescriptor.Secrets, CiCd: ResolvedCommonServerDescriptor.CiCd, Templates: map[string]api.StackDescriptor{ "stack-per-app": ResolvedCommonServerDescriptor.Templates["stack-per-app"], }, Variables: map[string]api.VariableDescriptor{ "atlas-region": { Type: "string", Value: "US_SOUTH_1", }, "atlas-project-id": { Type: "string", Value: "5b89110a4e6581562623c59c", }, "atlas-org-id": { Type: "string", Value: "5b89110a4e6581562623c59c", }, "atlas-instance-size": { Type: "string", Value: "M10", }, }, Resources: api.PerStackResourcesDescriptor{ Registrar: ResolvedCommonServerDescriptor.Resources.Registrar, Resources: map[string]api.PerEnvResourcesDescriptor{ "staging": { Template: "stack-per-app", Resources: map[string]api.ResourceDescriptor{ "mongodb": resolvedMongodbAtlasResource, "postgres": { Type: gcpApi.ResourceTypePostgresGcpCloudsql, Config: api.Config{Config: &gcpApi.PostgresGcpCloudsqlConfig{ Version: "14.5", Project: "refapp", Credentials: gcpApi.Credentials{ Credentials: api.Credentials{ Credentials: "<gcloud-service-account-email>", }, ServiceAccountConfig: gcpApi.ServiceAccountConfig{ ProjectId: "test-gcp-project", }, }, }}, }, }, }, "prod": { Template: "stack-per-app", Resources: map[string]api.ResourceDescriptor{ "mongodb": resolvedMongodbAtlasResource, "postgres": { Type: gcpApi.ResourceTypePostgresGcpCloudsql, Config: api.Config{Config: &gcpApi.PostgresGcpCloudsqlConfig{ Version: "14.5", Project: "refapp", Credentials: gcpApi.Credentials{ Credentials: api.Credentials{ Credentials: "<gcloud-service-account-email>", }, ServiceAccountConfig: gcpApi.ServiceAccountConfig{ ProjectId: "test-gcp-project", }, }, }}, }, }, }, }, }, }
View Source
var ResolvedRefappStaticGCPServerDescriptor = &api.ServerDescriptor{ SchemaVersion: api.ServerSchemaVersion, Provisioner: ResolvedCommonServerDescriptor.Provisioner, Secrets: ResolvedCommonServerDescriptor.Secrets, CiCd: ResolvedCommonServerDescriptor.CiCd, Templates: map[string]api.StackDescriptor{ "static-website": { Type: gcpApi.TemplateTypeStaticWebsite, Config: api.Config{Config: &gcpApi.TemplateConfig{ Credentials: gcpApi.Credentials{ Credentials: api.Credentials{ Credentials: "<gcloud-service-account-email>", }, ServiceAccountConfig: gcpApi.ServiceAccountConfig{ ProjectId: "test-gcp-project", }, }, }}, }, }, Resources: api.PerStackResourcesDescriptor{ Registrar: ResolvedCommonServerDescriptor.Resources.Registrar, Resources: map[string]api.PerEnvResourcesDescriptor{ "staging": { Template: "static-website", }, "prod": { Template: "static-website", }, }, }, }
Functions ¶
func ResolvedFsStateStorage ¶
func ResolvedFsStateStorage() *fs.FileSystemStateStorage
func ResolvedFsStateStorageServerDescriptor ¶
func ResolvedFsStateStorageServerDescriptor() api.ServerDescriptor
func ResolvedRefappAwsLambdaClientDescriptor ¶
func ResolvedRefappAwsLambdaClientDescriptor() *api.ClientDescriptor
func ResolvedRefappClientDescriptor ¶
func ResolvedRefappClientDescriptor(gitRoot string) *api.ClientDescriptor
func ResolvedRefappCloudClientDescriptor ¶
func ResolvedRefappCloudClientDescriptor(gitRoot string, desc *api.ClientDescriptor) *api.ClientDescriptor
Types ¶
This section is empty.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.