Documentation ¶
Index ¶
- Constants
- func DeployBootstrapStage(t testing.TB, s steps.Steps, tfvars GlobalTFVars, c CommonConf) error
- func DeployEnvStage(t testing.TB, s steps.Steps, tfvars GlobalTFVars, outputs BootstrapOutputs, ...) error
- func DeployExampleAppStage(t testing.TB, s steps.Steps, tfvars GlobalTFVars, outputs InfraPipelineOutputs, ...) error
- func DeployNetworksStage(t testing.TB, s steps.Steps, tfvars GlobalTFVars, outputs BootstrapOutputs, ...) error
- func DeployOrgStage(t testing.TB, s steps.Steps, tfvars GlobalTFVars, outputs BootstrapOutputs, ...) error
- func DeployProjectsStage(t testing.TB, s steps.Steps, tfvars GlobalTFVars, outputs BootstrapOutputs, ...) error
- func DestroyBootstrapStage(t testing.TB, s steps.Steps, c CommonConf) error
- func DestroyEnvStage(t testing.TB, s steps.Steps, outputs BootstrapOutputs, c CommonConf) error
- func DestroyExampleAppStage(t testing.TB, s steps.Steps, outputs InfraPipelineOutputs, c CommonConf) error
- func DestroyNetworksStage(t testing.TB, s steps.Steps, outputs BootstrapOutputs, c CommonConf) error
- func DestroyOrgStage(t testing.TB, s steps.Steps, outputs BootstrapOutputs, c CommonConf) error
- func DestroyProjectsStage(t testing.TB, s steps.Steps, outputs BootstrapOutputs, c CommonConf) error
- func GetNetworkStep(enableHubAndSpoke bool) string
- func TerraformVet(t testing.TB, terraformDir, policyPath, project string) error
- func ValidateBasicFields(t testing.TB, g GlobalTFVars)
- func ValidateDestroyFlags(t testing.TB, g GlobalTFVars)
- func ValidateDirectories(g GlobalTFVars) error
- type AppInfraCommonTfvars
- type BootstrapOutputs
- type BootstrapTfvars
- type CommonConf
- type EnvsTfvars
- type GcpGroups
- type GlobalTFVars
- type Groups
- type InfraPipelineOutputs
- type NetAccessContextTfvars
- type NetCommonTfvars
- type NetSharedTfvars
- type OptionalGroups
- type OrgTfvars
- type ProjCommonTfvars
- type ProjEnvTfvars
- type ProjSharedTfvars
- type RequiredGroups
- type ServerAddress
- type StageConf
Constants ¶
const ( PoliciesRepo = "gcp-policies" BootstrapRepo = "gcp-bootstrap" OrgRepo = "gcp-org" EnvironmentsRepo = "gcp-environments" NetworksRepo = "gcp-networks" ProjectsRepo = "gcp-projects" AppInfraRepo = "bu1-example-app" BootstrapStep = "0-bootstrap" OrgStep = "1-org" EnvironmentsStep = "2-environments" HubAndSpokeStep = "3-networks-hub-and-spoke" DualSvpcStep = "3-networks-dual-svpc" ProjectsStep = "4-projects" AppInfraStep = "5-app-infra" )
const (
MaxBuildRetries = 40
)
Variables ¶
This section is empty.
Functions ¶
func DeployBootstrapStage ¶
func DeployBootstrapStage(t testing.TB, s steps.Steps, tfvars GlobalTFVars, c CommonConf) error
func DeployEnvStage ¶
func DeployEnvStage(t testing.TB, s steps.Steps, tfvars GlobalTFVars, outputs BootstrapOutputs, c CommonConf) error
func DeployExampleAppStage ¶
func DeployExampleAppStage(t testing.TB, s steps.Steps, tfvars GlobalTFVars, outputs InfraPipelineOutputs, c CommonConf) error
func DeployNetworksStage ¶
func DeployNetworksStage(t testing.TB, s steps.Steps, tfvars GlobalTFVars, outputs BootstrapOutputs, c CommonConf) error
func DeployOrgStage ¶
func DeployOrgStage(t testing.TB, s steps.Steps, tfvars GlobalTFVars, outputs BootstrapOutputs, c CommonConf) error
func DeployProjectsStage ¶
func DeployProjectsStage(t testing.TB, s steps.Steps, tfvars GlobalTFVars, outputs BootstrapOutputs, c CommonConf) error
func DestroyBootstrapStage ¶
func DestroyBootstrapStage(t testing.TB, s steps.Steps, c CommonConf) error
func DestroyEnvStage ¶
func DestroyEnvStage(t testing.TB, s steps.Steps, outputs BootstrapOutputs, c CommonConf) error
func DestroyExampleAppStage ¶
func DestroyExampleAppStage(t testing.TB, s steps.Steps, outputs InfraPipelineOutputs, c CommonConf) error
func DestroyNetworksStage ¶
func DestroyNetworksStage(t testing.TB, s steps.Steps, outputs BootstrapOutputs, c CommonConf) error
func DestroyOrgStage ¶
func DestroyOrgStage(t testing.TB, s steps.Steps, outputs BootstrapOutputs, c CommonConf) error
func DestroyProjectsStage ¶
func DestroyProjectsStage(t testing.TB, s steps.Steps, outputs BootstrapOutputs, c CommonConf) error
func GetNetworkStep ¶
func TerraformVet ¶
TerraformVet runs gcloud terraform vet on the plan of the provided terraform directory
func ValidateBasicFields ¶
func ValidateBasicFields(t testing.TB, g GlobalTFVars)
ValidateBasicFields validates if the values for the required field were provided
func ValidateDestroyFlags ¶
func ValidateDestroyFlags(t testing.TB, g GlobalTFVars)
ValidateDestroyFlags checks if the flags to allow the destruction of the infrastructure are enabled
func ValidateDirectories ¶
func ValidateDirectories(g GlobalTFVars) error
ValidateDirectories checks if the required directories exist
Types ¶
type AppInfraCommonTfvars ¶
type BootstrapOutputs ¶
type BootstrapOutputs struct { RemoteStateBucket string RemoteStateBucketProjects string CICDProject string DefaultRegion string NetworkSA string ProjectsSA string EnvsSA string OrgSA string BootstrapSA string RequiredGroups map[string]string }
func GetBootstrapStepOutputs ¶
func GetBootstrapStepOutputs(t testing.TB, foundationPath string) BootstrapOutputs
type BootstrapTfvars ¶
type BootstrapTfvars struct { OrgID string `hcl:"org_id"` BillingAccount string `hcl:"billing_account"` DefaultRegion string `hcl:"default_region"` ParentFolder *string `hcl:"parent_folder"` ProjectPrefix *string `hcl:"project_prefix"` FolderPrefix *string `hcl:"folder_prefix"` BucketForceDestroy *bool `hcl:"bucket_force_destroy"` BucketTfstateKmsForceDestroy *bool `hcl:"bucket_tfstate_kms_force_destroy"` Groups Groups `hcl:"groups"` InitialGroupConfig *string `hcl:"initial_group_config"` }
type CommonConf ¶
type EnvsTfvars ¶
type EnvsTfvars struct {
RemoteStateBucket string `hcl:"remote_state_bucket"`
}
type GlobalTFVars ¶
type GlobalTFVars struct { OrgID string `hcl:"org_id"` BillingAccount string `hcl:"billing_account"` DefaultRegion string `hcl:"default_region"` ParentFolder *string `hcl:"parent_folder"` Domain string `hcl:"domain"` DomainsToAllow []string `hcl:"domains_to_allow"` EssentialContactsDomains []string `hcl:"essential_contacts_domains_to_allow"` PerimeterAdditionalMembers []string `hcl:"perimeter_additional_members"` TargetNameServerAddresses []ServerAddress `hcl:"target_name_server_addresses"` SccNotificationName string `hcl:"scc_notification_name"` ProjectPrefix *string `hcl:"project_prefix"` FolderPrefix *string `hcl:"folder_prefix"` CaiMonitoringKmsForceDestroy *bool `hcl:"cai_monitoring_kms_force_destroy"` BucketForceDestroy *bool `hcl:"bucket_force_destroy"` BucketTfstateKmsForceDestroy *bool `hcl:"bucket_tfstate_kms_force_destroy"` AuditLogsTableDeleteContentsOnDestroy *bool `hcl:"audit_logs_table_delete_contents_on_destroy"` LogExportStorageForceDestroy *bool `hcl:"log_export_storage_force_destroy"` LogExportStorageLocation string `hcl:"log_export_storage_location"` BillingExportDatasetLocation string `hcl:"billing_export_dataset_location"` EnableHubAndSpoke bool `hcl:"enable_hub_and_spoke"` EnableHubAndSpokeTransitivity bool `hcl:"enable_hub_and_spoke_transitivity"` CreateUniqueTagKey bool `hcl:"create_unique_tag_key"` ProjectsKMSLocation string `hcl:"projects_kms_location"` ProjectsGCSLocation string `hcl:"projects_gcs_location"` CodeCheckoutPath string `hcl:"code_checkout_path"` FoundationCodePath string `hcl:"foundation_code_path"` ValidatorProjectId *string `hcl:"validator_project_id"` Groups Groups `hcl:"groups"` InitialGroupConfig *string `hcl:"initial_group_config"` }
GlobalTFVars contains all the configuration for the deploy
func ReadGlobalTFVars ¶
func ReadGlobalTFVars(file string) (GlobalTFVars, error)
ReadGlobalTFVars reads the tfvars file that has all the configuration for the deploy
func (GlobalTFVars) CheckString ¶
func (g GlobalTFVars) CheckString(s string)
CheckString checks if any of the string fields in the GlobalTFVars has the given string
func (GlobalTFVars) HasGroupsCreation ¶
func (g GlobalTFVars) HasGroupsCreation() bool
HasGroupsCreation checks if Groups creation is enabled
func (GlobalTFVars) HasOptionalGroupsCreation ¶
func (g GlobalTFVars) HasOptionalGroupsCreation() bool
HasOptionalGroupsCreation checks if Optional Groups creation is enabled
func (GlobalTFVars) HasRequiredGroupsCreation ¶
func (g GlobalTFVars) HasRequiredGroupsCreation() bool
HasRequiredGroupsCreation checks if Required Groups creation is enabled
func (GlobalTFVars) HasValidatorProj ¶
func (g GlobalTFVars) HasValidatorProj() bool
HasValidatorProj checks if a Validator Project was provided
type Groups ¶
type Groups struct { CreateRequiredGroups *bool `cty:"create_required_groups"` CreateOptionalGroups *bool `cty:"create_optional_groups"` BillingProject *string `cty:"billing_project"` RequiredGroups RequiredGroups `cty:"required_groups"` OptionalGroups *OptionalGroups `cty:"optional_groups"` }
type InfraPipelineOutputs ¶
type InfraPipelineOutputs struct { RemoteStateBucket string InfraPipeProj string DefaultRegion string TerraformSA string StateBucket string }
func GetInfraPipelineOutputs ¶
func GetInfraPipelineOutputs(t testing.TB, checkoutPath, workspace string) InfraPipelineOutputs
type NetAccessContextTfvars ¶
type NetAccessContextTfvars struct {
AccessContextManagerPolicyID string `hcl:"access_context_manager_policy_id"`
}
type NetCommonTfvars ¶
type NetSharedTfvars ¶
type NetSharedTfvars struct {
}type OptionalGroups ¶
type OrgTfvars ¶
type OrgTfvars struct { DomainsToAllow []string `hcl:"domains_to_allow"` EssentialContactsDomains []string `hcl:"essential_contacts_domains_to_allow"` SccNotificationName string `hcl:"scc_notification_name"` RemoteStateBucket string `hcl:"remote_state_bucket"` EnableHubAndSpoke bool `hcl:"enable_hub_and_spoke"` CreateACMAPolicy bool `hcl:"create_access_context_manager_access_policy"` CreateUniqueTagKey bool `hcl:"create_unique_tag_key"` CaiMonitoringKmsForceDestroy *bool `hcl:"cai_monitoring_kms_force_destroy"` AuditLogsTableDeleteContentsOnDestroy *bool `hcl:"audit_logs_table_delete_contents_on_destroy"` LogExportStorageForceDestroy *bool `hcl:"log_export_storage_force_destroy"` LogExportStorageLocation string `hcl:"log_export_storage_location"` BillingExportDatasetLocation string `hcl:"billing_export_dataset_location"` GcpGroups GcpGroups `hcl:"gcp_groups"` }
type ProjCommonTfvars ¶
type ProjCommonTfvars struct {
RemoteStateBucket string `hcl:"remote_state_bucket"`
}
type ProjEnvTfvars ¶
type ProjSharedTfvars ¶
type ProjSharedTfvars struct {
}type RequiredGroups ¶
type ServerAddress ¶
type ServerAddress struct { Ipv4Address string `cty:"ipv4_address"` ForwardingPath string `cty:"forwarding_path"` }
ServerAddress is the element for TargetNameServerAddresses