mwsimport

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2026 License: MPL-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const BuilderId = "packer.post-processor.mws-import"

Variables

This section is empty.

Functions

This section is empty.

Types

type AWSClient

type AWSClient interface {
	PresignGetObject(ctx context.Context, params *s3.GetObjectInput, optFns ...func(*s3.PresignOptions)) (*v4.PresignedHTTPRequest, error)
}

type Artifact

type Artifact struct {
	StateData map[string]any
	// contains filtered or unexported fields
}

func NewArtifact

func NewArtifact(driver Driver, image *computemodel.ImageOptionalResponse, generatedData any) *Artifact

func (*Artifact) BuilderId

func (*Artifact) BuilderId() string

func (*Artifact) Destroy

func (a *Artifact) Destroy() error

func (*Artifact) Files

func (*Artifact) Files() []string

func (*Artifact) Id

func (a *Artifact) Id() string

func (*Artifact) State

func (a *Artifact) State(name string) any

func (*Artifact) String

func (a *Artifact) String() string

type Config

type Config struct {
	common.PackerConfig              `mapstructure:",squash"`
	commonconfig.AccessConfig        `mapstructure:",squash"`
	commonconfig.ImageConfig         `mapstructure:",squash"`
	commonconfig.ObjectStorageConfig `mapstructure:",squash"`
	// MWS Cloud Platform Object Storage path from where the image will be imported.
	ObjectStoragePath string `mapstructure:"object_storage_path" required:"true"`

	// Timeout for resources cleanup (defaults to "1h").
	CleanupTimeout time.Duration `mapstructure:"cleanup_timeout" required:"false"`
	// contains filtered or unexported fields
}

func (*Config) FlatMapstructure

func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec }

FlatMapstructure returns a new FlatConfig. FlatConfig is an auto-generated flat version of Config. Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.

func (*Config) Prepare

func (c *Config) Prepare(raws ...any) error

func (*Config) SetDefaults

func (c *Config) SetDefaults()

func (*Config) Validate

func (c *Config) Validate() error

type FlatConfig

type FlatConfig struct {
	PackerBuildName                 *string           `mapstructure:"packer_build_name" cty:"packer_build_name" hcl:"packer_build_name"`
	PackerBuilderType               *string           `mapstructure:"packer_builder_type" cty:"packer_builder_type" hcl:"packer_builder_type"`
	PackerCoreVersion               *string           `mapstructure:"packer_core_version" cty:"packer_core_version" hcl:"packer_core_version"`
	PackerDebug                     *bool             `mapstructure:"packer_debug" cty:"packer_debug" hcl:"packer_debug"`
	PackerForce                     *bool             `mapstructure:"packer_force" cty:"packer_force" hcl:"packer_force"`
	PackerOnError                   *string           `mapstructure:"packer_on_error" cty:"packer_on_error" hcl:"packer_on_error"`
	PackerUserVars                  map[string]string `mapstructure:"packer_user_variables" cty:"packer_user_variables" hcl:"packer_user_variables"`
	PackerSensitiveVars             []string          `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables" hcl:"packer_sensitive_variables"`
	Project                         *string           `mapstructure:"project" required:"true" cty:"project" hcl:"project"`
	Zone                            *string           `mapstructure:"zone" required:"false" cty:"zone" hcl:"zone"`
	BaseEndpoint                    *string           `mapstructure:"base_endpoint" required:"false" cty:"base_endpoint" hcl:"base_endpoint"`
	ServiceAccountAuthorizedKeyPath *string           `` /* 151-byte string literal not displayed */
	Token                           *string           `mapstructure:"token" required:"false" cty:"token" hcl:"token"`
	ImageName                       *string           `mapstructure:"image_name" required:"false" cty:"image_name" hcl:"image_name"`
	ImageDisplayName                *string           `mapstructure:"image_display_name" required:"false" cty:"image_display_name" hcl:"image_display_name"`
	ImageDescription                *string           `mapstructure:"image_description" required:"false" cty:"image_description" hcl:"image_description"`
	ServiceAccount                  *string           `mapstructure:"service_account" required:"false" cty:"service_account" hcl:"service_account"`
	AccessKey                       *string           `mapstructure:"access_key" required:"false" cty:"access_key" hcl:"access_key"`
	SecretKey                       *string           `mapstructure:"secret_key" required:"false" cty:"secret_key" hcl:"secret_key"`
	ObjectStorageEndpoint           *string           `mapstructure:"object_storage_endpoint" required:"false" cty:"object_storage_endpoint" hcl:"object_storage_endpoint"`
	ObjectStorageRegion             *string           `mapstructure:"object_storage_region" required:"false" cty:"object_storage_region" hcl:"object_storage_region"`
	ObjectStoragePath               *string           `mapstructure:"object_storage_path" required:"true" cty:"object_storage_path" hcl:"object_storage_path"`
	CleanupTimeout                  *string           `mapstructure:"cleanup_timeout" required:"false" cty:"cleanup_timeout" hcl:"cleanup_timeout"`
}

FlatConfig is an auto-generated flat version of Config. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.

func (*FlatConfig) HCL2Spec

func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec

HCL2Spec returns the hcl spec of a Config. This spec is used by HCL to read the fields of Config. The decoded values from this spec will then be applied to a FlatConfig.

type PostProcessor

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

func (*PostProcessor) ConfigSpec

func (p *PostProcessor) ConfigSpec() hcldec.ObjectSpec

func (*PostProcessor) Configure

func (p *PostProcessor) Configure(raws ...any) error

func (*PostProcessor) PostProcess

func (p *PostProcessor) PostProcess(ctx context.Context, ui packer.Ui, _ packer.Artifact) (packer.Artifact, bool, bool, error)

type StepCreateAWSClient

type StepCreateAWSClient struct {
	Endpoint string
	Region   string
	Path     string
}

func (*StepCreateAWSClient) Cleanup

func (*StepCreateAWSClient) Run

type StepCreateSignedLink struct {
	Path string
}

func (*StepCreateSignedLink) Cleanup

func (*StepCreateSignedLink) Run

type StepImportImage

type StepImportImage struct {
	Project          string
	ImageName        string
	ImageDisplayName string
	ImageDescription string

	GeneratedData *packerbuilderdata.GeneratedData
}

func (*StepImportImage) Cleanup

func (*StepImportImage) Run

Directories

Path Synopsis
Package mock_mwsimport is a generated GoMock package.
Package mock_mwsimport is a generated GoMock package.

Jump to

Keyboard shortcuts

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