mwsimport

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: MPL-2.0 Imports: 26 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	DefaultObjectStorageRegion   = "ru-central1"
	DefaultObjectStorageEndpoint = "https://storage.mwsapis.ru"
)
View Source
const (
	ExternalURLKey = "external_url"
	AWSClientKey   = "aws_client"
)
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"`
	ObjectStorageConfig       `mapstructure:",squash"`

	// 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 Driver

type Driver interface {
	ImportImage(context.Context, drivermws.ImportImageParams) (*computemodel.ImageOptionalResponse, error)
	DeleteImage(context.Context, string) 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"`
	ObjectStoragePath               *string           `mapstructure:"object_storage_path" required:"true" cty:"object_storage_path" hcl:"object_storage_path"`
	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"`
	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 ObjectStorageConfig

type ObjectStorageConfig struct {
	// MWS Cloud Platform Service Account used for generating temporal HMAC key
	// to access Object Storage. Required, unless `access_key` and `secret_key`
	// are provided.
	ServiceAccount string `mapstructure:"service_account" required:"false"`

	// HMAC key identifier for authenticating with Object Storage. Used if
	// `service_account` is not provided. Also requires `secret_key` to be
	// provided.
	AccessKey string `mapstructure:"access_key" required:"false"`
	// HMAC key secret for accessing Object Storage. Required if `access_key` is
	// provided.
	SecretKey string `mapstructure:"secret_key" required:"false"`

	// MWS Cloud Platform Object Storage path from where the image will be imported.
	ObjectStoragePath string `mapstructure:"object_storage_path" required:"true"`
	// MWS Cloud Platform Object Storage endpoint to import image from (defaults to "https://storage.mwsapis.ru").
	ObjectStorageEndpoint string `mapstructure:"object_storage_endpoint" required:"false"`
	// MWS Cloud Platform Object Storage region where the bucket is located (defaults to "ru-central1").
	ObjectStorageRegion string `mapstructure:"object_storage_region" required:"false"`
}

func (*ObjectStorageConfig) SetDefaults

func (c *ObjectStorageConfig) SetDefaults()

func (*ObjectStorageConfig) Validate

func (c *ObjectStorageConfig) Validate() error

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