policygen

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2023 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Overview

Package policygen implements the Policy Generator.

Index

Constants

This section is empty.

Variables

View Source
var Schema = []byte(`
title = "Policy Generator Config Schema"
additionalProperties = false
required = ["template_dir"]

properties = {
  version = {
    description = <<EOF
      Optional constraint on the binary version required for this config.
      See [syntax](https://www.terraform.io/docs/configuration/version-constraints.html).
    EOF
    type        = "string"
  }

  template_dir = {
    description = <<EOF
      Absolute or relative path to the template directory. If relative, this path
      is relative to the directory where the config file lives.
    EOF
    type = "string"
  }

  forseti_policies = {
    description = "Key value pairs configure Forseti Policy Library constraints."
    type = "object"
    additionalProperties = false
    required = ["targets"]
    properties = {
      targets = {
        description = <<EOF
          List of targets to apply the policies, e.g. organizations/**,
          organizations/123/folders/456.
        EOF
        type = "array"
        items = {
          type = "string"
        }
      }

      allowed_policy_member_domains = {
        description = "The list of domains to allow users from, e.g. example.com"
        type = "array"
        items = {
          type = "string"
        }
      }
    }
  }
}
`)

Schema is the policygen input schema. TODO(https://github.com/golang/go/issues/35950): Move this to its own file.

Functions

func Run

func Run(ctx context.Context, rn runner.Runner, args *RunArgs) error

Run executes main policygen logic.

Types

type RunArgs

type RunArgs struct {
	ConfigPath string
	StatePaths []string
	OutputPath string
}

RunArgs is the struct representing the arguments passed to Run().

Jump to

Keyboard shortcuts

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