apply

package
v0.0.0-...-1160ede Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 11 Imported by: 4

Documentation

Overview

Package apply provides utilities to apply a project config to GCP by deploying all defined resources.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Forseti

func Forseti(conf *config.Config, opts *Options, terraformConfigsDir string, rn runner.Runner) error

Forseti applies project configuration to a Forseti project.

func GrantForsetiPermissions

func GrantForsetiPermissions(projectID, serviceAccount, stateBucket string, opts *Options, workDir string, rn runner.Runner) error

GrantForsetiPermissions grants all necessary permissions to the given Forseti service account in the project.

func RemoveDeprecatedBigqueryAPI

func RemoveDeprecatedBigqueryAPI(dir string, rn runner.Runner) error

RemoveDeprecatedBigqueryAPI removes the deprecated BigqueryAPI if it was deployed. https://www.terraform.io/docs/providers/google/guides/version_3_upgrade.html#resource-google_project_service.

func Terraform

func Terraform(conf *config.Config, projectIDs []string, opts *Options, rn runner.Runner) error

Terraform applies the project configs for each applicable project in the config to GCP. Empty list of projects is equivalent to all projects. Base projects (remote audit and forseti) are deployed in a round-table fashion with each phase being applied to each project. This makes sure dependencies between base projects are handled correctly (e.g. forseti project wants to store its audit logs in remote audit project while remote audit project wants to be monitored by the forseti project). Then, all data hosting projects are deployed from beginning till end so one data project doesn't leave other data projects in a half deployed state.

Types

type Options

type Options struct {
	// Toggle whether dry run mode is enabled.
	DryRun bool
	// Toggle whether existing resources will attempt to be imported.
	// Used when migrating an existing project. Only needs to be done once.
	ImportExisting bool
	// Normalized directory path to store generated Terraform configs.
	TerraformConfigsPath string
	// Extra flags to pass to terraform apply command.
	TerraformApplyFlags []string
}

Options configures an apply call.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL