provider

package
v0.0.0-...-4511d6e Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: Apache-2.0 Imports: 49 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ResourceDeleteOverrides = map[string]func(
	providerInstance *googleCloudProvider,
	res resources.CloudAPIResource,
	inputs, outputs map[string]interface{},
) error{
	"google-native:cloudkms/v1:CryptoKey": func(
		providerInstance *googleCloudProvider,
		res resources.CloudAPIResource,
		inputs, outputs map[string]interface{},
	) error {

		ctx := context.Background()
		clientkms, err := cloudkms.NewService(ctx, option.WithHTTPClient(providerInstance.client.HTTPClient()))
		if err != nil {
			return err
		}
		name := outputs["name"].(string)

		versionsClient := clientkms.Projects.Locations.KeyRings.CryptoKeys.CryptoKeyVersions
		versionsResponse, err := versionsClient.List(name).Do()
		if err != nil {
			return err
		}

		for _, version := range versionsResponse.CryptoKeyVersions {
			request := &cloudkms.DestroyCryptoKeyVersionRequest{}
			_, err = versionsClient.Destroy(version.Name, request).Do()
			if err != nil {
				return err
			}
		}

		if _, ok := outputs["rotationPeriod"]; ok {
			keyClient := clientkms.Projects.Locations.KeyRings.CryptoKeys
			_, err = keyClient.
				Patch(
					name,
					&cloudkms.CryptoKey{
						NullFields: []string{"rotationPeriod", "nextRotationTime"},
					}).
				UpdateMask("rotationPeriod,nextRotationTime").Do()
			if err != nil {
				return err
			}
		}

		return nil
	},
}

Functions

func Serve

func Serve(providerName, version string, schemaBytes []byte, metadataBytes []byte)

Serve launches the gRPC server for the resource provider.

Types

type Condition

type Condition struct {
	Type    string
	Status  string
	Reason  string
	Message string
}

type KnativeStatus

type KnativeStatus struct {
	Metadata struct {
		Name      string
		Namespace string
		SelfLink  string
	}
	Status struct {
		Conditions         []Condition
		ObservedGeneration float64
	}
}

KnativeStatus is a struct that can contain a Knative style resource's Status block. It is not intended to be used for anything other than polling for the success of the given resource.

type LogRedirector

type LogRedirector struct {
	// contains filtered or unexported fields
}

LogRedirector creates a new redirection writer that takes as input plugin stderr output, and routes it to the correct Pulumi stream based on the standard Terraform logging output prefixes.

func (*LogRedirector) Disable

func (lr *LogRedirector) Disable()

Disable disables most of the specific logging levels, but it retains debug logging.

func (*LogRedirector) Enable

func (lr *LogRedirector) Enable()

Enable turns on full featured logging. This is the default.

func (*LogRedirector) Write

func (lr *LogRedirector) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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