Documentation
¶
Overview ¶
Code generated by "mapstructure-to-hcl2 -type VaultAWSEngineOptions"; DO NOT EDIT.
Code generated by "mapstructure-to-hcl2 -type BlockDevice"; DO NOT EDIT.
Code generated by "mapstructure-to-hcl2 -type AmiFilterOptions,SecurityGroupFilterOptions,SubnetFilterOptions,VpcFilterOptions,PolicyDocument,Statement"; DO NOT EDIT.
Index ¶
- Variables
- func DecodeAuthZMessages(sess *session.Session)
- func DestroyAMIs(imageids []*string, ec2conn *ec2.EC2) error
- func LogEnvOverrideWarnings()
- func SSHHost(e ec2Describer, sshInterface string, host string) func(multistep.StateBag) (string, error)
- func WaitForImageToBeImported(c *ec2.EC2, ctx aws.Context, input *ec2.DescribeImportImageTasksInput, ...) error
- func WaitForVolumeToBeAttached(c *ec2.EC2, ctx aws.Context, input *ec2.DescribeVolumesInput, ...) error
- func WaitForVolumeToBeDetached(c *ec2.EC2, ctx aws.Context, input *ec2.DescribeVolumesInput, ...) error
- func WaitUntilAMIAvailable(ctx aws.Context, conn ec2iface.EC2API, imageId string) error
- func WaitUntilImageImported(ctx aws.Context, conn *ec2.EC2, taskID string) error
- func WaitUntilInstanceRunning(ctx aws.Context, conn *ec2.EC2, instanceId string) error
- func WaitUntilInstanceTerminated(ctx aws.Context, conn *ec2.EC2, instanceId string) error
- func WaitUntilSnapshotDone(ctx aws.Context, conn *ec2.EC2, snapshotID string) error
- func WaitUntilSpotRequestFulfilled(ctx aws.Context, conn *ec2.EC2, spotRequestId string) error
- func WaitUntilVolumeAttached(ctx aws.Context, conn *ec2.EC2, volumeId string) error
- func WaitUntilVolumeAvailable(ctx aws.Context, conn *ec2.EC2, volumeId string) error
- func WaitUntilVolumeDetached(ctx aws.Context, conn *ec2.EC2, volumeId string) error
- type AMIConfig
- type AccessConfig
- func (c *AccessConfig) GetCredsFromVault() error
- func (c *AccessConfig) IsChinaCloud() bool
- func (c *AccessConfig) IsGovCloud() bool
- func (c *AccessConfig) NewEC2Connection() (ec2iface.EC2API, error)
- func (c *AccessConfig) Prepare(ctx *interpolate.Context) []error
- func (c *AccessConfig) Session() (*session.Session, error)
- func (c *AccessConfig) SessionRegion() string
- func (c *AccessConfig) ValidateRegion(regions ...string) error
- type AmiFilterOptions
- type Artifact
- type BlockDevice
- type BlockDevices
- type BuildInfoTemplate
- type EC2BlockDeviceMappingsBuilder
- type EC2Tags
- type FlatAmiFilterOptions
- type FlatBlockDevice
- type FlatPolicyDocument
- type FlatSecurityGroupFilterOptions
- type FlatStatement
- type FlatSubnetFilterOptions
- type FlatVaultAWSEngineOptions
- type FlatVpcFilterOptions
- type PolicyDocument
- type RunConfig
- type SecurityGroupFilterOptions
- type StateChangeConf
- type StateRefreshFunc
- type Statement
- type StepAMIRegionCopy
- type StepCleanupVolumes
- type StepCreateTags
- type StepDeregisterAMI
- type StepGetPassword
- type StepIamInstanceProfile
- type StepKeyPair
- type StepModifyAMIAttributes
- type StepModifyEBSBackedInstance
- type StepNetworkInfo
- type StepPreValidate
- type StepRunSourceInstance
- type StepRunSpotInstance
- func (s *StepRunSpotInstance) Cleanup(state multistep.StateBag)
- func (s *StepRunSpotInstance) CreateTemplateData(userData *string, az string, state multistep.StateBag, ...) *ec2.RequestLaunchTemplateData
- func (s *StepRunSpotInstance) LoadUserData() (string, error)
- func (s *StepRunSpotInstance) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
- type StepSecurityGroup
- type StepSourceAMIInfo
- type StepStopEBSBackedInstance
- type SubnetFilterOptions
- type TagMap
- type VaultAWSEngineOptions
- type VpcFilterOptions
Constants ¶
This section is empty.
Variables ¶
var TemplateFuncs = template.FuncMap{
"clean_resource_name": templateCleanAMIName,
}
Functions ¶
func DecodeAuthZMessages ¶ added in v1.3.1
DecodeAuthZMessages enables automatic decoding of any encoded authorization messages
func DestroyAMIs ¶ added in v1.4.5
DestroyAMIs deregisters the AWS machine images in imageids from an active AWS account
func LogEnvOverrideWarnings ¶ added in v1.3.4
func LogEnvOverrideWarnings()
func SSHHost ¶ added in v0.8.0
func SSHHost(e ec2Describer, sshInterface string, host string) func(multistep.StateBag) (string, error)
SSHHost returns a function that can be given to the SSH communicator for determining the SSH address based on the instance DNS name.
func WaitForImageToBeImported ¶ added in v1.2.5
func WaitForImageToBeImported(c *ec2.EC2, ctx aws.Context, input *ec2.DescribeImportImageTasksInput, opts ...request.WaiterOption) error
func WaitForVolumeToBeAttached ¶ added in v1.2.5
func WaitForVolumeToBeAttached(c *ec2.EC2, ctx aws.Context, input *ec2.DescribeVolumesInput, opts ...request.WaiterOption) error
func WaitForVolumeToBeDetached ¶ added in v1.2.5
func WaitForVolumeToBeDetached(c *ec2.EC2, ctx aws.Context, input *ec2.DescribeVolumesInput, opts ...request.WaiterOption) error
func WaitUntilAMIAvailable ¶ added in v1.2.5
func WaitUntilImageImported ¶ added in v1.2.5
func WaitUntilInstanceRunning ¶ added in v1.5.2
func WaitUntilInstanceTerminated ¶ added in v1.2.5
func WaitUntilSnapshotDone ¶ added in v1.2.5
func WaitUntilSpotRequestFulfilled ¶ added in v1.2.5
This function works for both requesting and cancelling spot instances.
func WaitUntilVolumeAttached ¶ added in v1.2.5
func WaitUntilVolumeAvailable ¶ added in v1.2.5
Types ¶
type AMIConfig ¶ added in v0.3.0
type AMIConfig struct { // The name of the resulting AMI that will appear when managing AMIs in the // AWS console or via APIs. This must be unique. To help make this unique, // use a function like timestamp (see [template // engine](../templates/engine.html) for more info). AMIName string `mapstructure:"ami_name" required:"true"` // The description to set for the resulting // AMI(s). By default this description is empty. This is a template // engine, see Build template // data for more information. AMIDescription string `mapstructure:"ami_description" required:"false"` // The type of virtualization for the AMI // you are building. This option is required to register HVM images. Can be // paravirtual (default) or hvm. AMIVirtType string `mapstructure:"ami_virtualization_type" required:"false"` // A list of account IDs that have access to // launch the resulting AMI(s). By default no additional users other than the // user creating the AMI has permissions to launch it. AMIUsers []string `mapstructure:"ami_users" required:"false"` // A list of groups that have access to // launch the resulting AMI(s). By default no groups have permission to launch // the AMI. all will make the AMI publicly accessible. AMIGroups []string `mapstructure:"ami_groups" required:"false"` // A list of product codes to // associate with the AMI. By default no product codes are associated with the // AMI. AMIProductCodes []string `mapstructure:"ami_product_codes" required:"false"` // A list of regions to copy the AMI to. // Tags and attributes are copied along with the AMI. AMI copying takes time // depending on the size of the AMI, but will generally take many minutes. AMIRegions []string `mapstructure:"ami_regions" required:"false"` // Set to true if you want to skip // validation of the ami_regions configuration option. Default false. AMISkipRegionValidation bool `mapstructure:"skip_region_validation" required:"false"` // Tags applied to the AMI. This is a // [template engine](/docs/templates/engine.html), see [Build template // data](#build-template-data) for more information. AMITags TagMap `mapstructure:"tags" required:"false"` // Enable enhanced networking (ENA but not SriovNetSupport) on // HVM-compatible AMIs. If set, add `ec2:ModifyInstanceAttribute` to your // AWS IAM policy. // // Note: you must make sure enhanced networking is enabled on your // instance. See [Amazon's documentation on enabling enhanced // networking](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/enhanced-networking.html#enabling_enhanced_networking). AMIENASupport config.Trilean `mapstructure:"ena_support" required:"false"` // Enable enhanced networking (SriovNetSupport but not ENA) on // HVM-compatible AMIs. If true, add `ec2:ModifyInstanceAttribute` to your // AWS IAM policy. Note: you must make sure enhanced networking is enabled // on your instance. See [Amazon's documentation on enabling enhanced // networking](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/enhanced-networking.html#enabling_enhanced_networking). // Default `false`. AMISriovNetSupport bool `mapstructure:"sriov_support" required:"false"` // Force Packer to first deregister an existing // AMI if one with the same name already exists. Default false. AMIForceDeregister bool `mapstructure:"force_deregister" required:"false"` // Force Packer to delete snapshots // associated with AMIs, which have been deregistered by force_deregister. // Default false. AMIForceDeleteSnapshot bool `mapstructure:"force_delete_snapshot" required:"false"` // Whether or not to encrypt the resulting AMI when // copying a provisioned instance to an AMI. By default, Packer will keep the // encryption setting to what it was in the source image. Setting false will // result in an unencrypted image, and true will result in an encrypted one. // If you have used the `launch_block_device_mappings` to set an encryption // key and that key is the same as the one you want the image encrypted with // at the end, then you don't need to set this field; leaving it empty will // prevent an unnecessary extra copy step and save you some time. AMIEncryptBootVolume config.Trilean `mapstructure:"encrypt_boot" required:"false"` // ID, alias or ARN of the KMS key to use for boot volume encryption. This // only applies to the main `region`, other regions where the AMI will be // copied will be encrypted by the default EBS KMS key. For valid formats // see *KmsKeyId* in the [AWS API docs - // CopyImage](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CopyImage.html). // This field is validated by Packer, when using an alias, you will have to // prefix `kms_key_id` with `alias/`. AMIKmsKeyId string `mapstructure:"kms_key_id" required:"false"` // regions to copy the ami to, along with the custom kms key id (alias or // arn) to use for encryption for that region. Keys must match the regions // provided in `ami_regions`. If you just want to encrypt using a default // ID, you can stick with `kms_key_id` and `ami_regions`. If you want a // region to be encrypted with that region's default key ID, you can use an // empty string `""` instead of a key id in this map. (e.g. `"us-east-1": // ""`) However, you cannot use default key IDs if you are using this in // conjunction with `snapshot_users` -- in that situation you must use // custom keys. For valid formats see *KmsKeyId* in the [AWS API docs - // CopyImage](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CopyImage.html). // // This option supercedes the `kms_key_id` option -- if you set both, and // they are different, Packer will respect the value in // `region_kms_key_ids` for your build region and silently disregard the // value provided in `kms_key_id`. AMIRegionKMSKeyIDs map[string]string `mapstructure:"region_kms_key_ids" required:"false"` // If true, Packer will not check whether an AMI with the `ami_name` exists // in the region it is building in. It will use an intermediary AMI name, // which it will not convert to an AMI in the build region. It will copy // the intermediary AMI into any regions provided in `ami_regions`, then // delete the intermediary AMI. Default `false`. AMISkipBuildRegion bool `mapstructure:"skip_save_build_region"` // Tags to apply to snapshot. // They will override AMI tags if already applied to snapshot. This is a // [template engine](../templates/engine.html), see [Build template // data](#build-template-data) for more information. SnapshotTags TagMap `mapstructure:"snapshot_tags" required:"false"` // A list of account IDs that have // access to create volumes from the snapshot(s). By default no additional // users other than the user creating the AMI has permissions to create // volumes from the backing snapshot(s). SnapshotUsers []string `mapstructure:"snapshot_users" required:"false"` // A list of groups that have access to // create volumes from the snapshot(s). By default no groups have permission // to create volumes from the snapshot(s). all will make the snapshot // publicly accessible. SnapshotGroups []string `mapstructure:"snapshot_groups" required:"false"` }
AMIConfig is for common configuration related to creating AMIs.
func (*AMIConfig) Prepare ¶ added in v0.3.0
func (c *AMIConfig) Prepare(accessConfig *AccessConfig, ctx *interpolate.Context) []error
type AccessConfig ¶
type AccessConfig struct { // The access key used to communicate with AWS. [Learn how to set this] // (/docs/builders/amazon.html#specifying-amazon-credentials). On EBS, this // is not required if you are using `use_vault_aws_engine` for // authentication instead. AccessKey string `mapstructure:"access_key" required:"true"` // This option is useful if you use a cloud // provider whose API is compatible with aws EC2. Specify another endpoint // like this https://ec2.custom.endpoint.com. CustomEndpointEc2 string `mapstructure:"custom_endpoint_ec2" required:"false"` // Enable automatic decoding of any encoded authorization (error) messages // using the `sts:DecodeAuthorizationMessage` API. Note: requires that the // effective user/role have permissions to `sts:DecodeAuthorizationMessage` // on resource `*`. Default `false`. DecodeAuthZMessages bool `mapstructure:"decode_authorization_messages" required:"false"` // This allows skipping TLS // verification of the AWS EC2 endpoint. The default is false. InsecureSkipTLSVerify bool `mapstructure:"insecure_skip_tls_verify" required:"false"` // This is the maximum number of times an API call is retried, in the case // where requests are being throttled or experiencing transient failures. // The delay between the subsequent API calls increases exponentially. MaxRetries int `mapstructure:"max_retries" required:"false"` // The MFA // [TOTP](https://en.wikipedia.org/wiki/Time-based_One-time_Password_Algorithm) // code. This should probably be a user variable since it changes all the // time. MFACode string `mapstructure:"mfa_code" required:"false"` // The profile to use in the shared credentials file for // AWS. See Amazon's documentation on [specifying // profiles](https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-profiles) // for more details. ProfileName string `mapstructure:"profile" required:"false"` // The name of the region, such as `us-east-1`, in which // to launch the EC2 instance to create the AMI. // When chroot building, this value is guessed from environment. RawRegion string `mapstructure:"region" required:"true"` // The secret key used to communicate with AWS. [Learn how to set // this](amazon.html#specifying-amazon-credentials). This is not required // if you are using `use_vault_aws_engine` for authentication instead. SecretKey string `mapstructure:"secret_key" required:"true"` // Set to true if you want to skip // validation of the ami_regions configuration option. Default false. SkipValidation bool `mapstructure:"skip_region_validation" required:"false"` SkipMetadataApiCheck bool `mapstructure:"skip_metadata_api_check"` // The access token to use. This is different from the // access key and secret key. If you're not sure what this is, then you // probably don't need it. This will also be read from the AWS_SESSION_TOKEN // environmental variable. Token string `mapstructure:"token" required:"false"` // Get credentials from Hashicorp Vault's aws secrets engine. You must // already have created a role to use. For more information about // generating credentials via the Vault engine, see the [Vault // docs.](https://www.vaultproject.io/api/secret/aws/index.html#generate-credentials) // If you set this flag, you must also set the below options: // - `name` (string) - Required. Specifies the name of the role to generate // credentials against. This is part of the request URL. // - `engine_name` (string) - The name of the aws secrets engine. In the // Vault docs, this is normally referred to as "aws", and Packer will // default to "aws" if `engine_name` is not set. // - `role_arn` (string)- The ARN of the role to assume if credential\_type // on the Vault role is assumed\_role. Must match one of the allowed role // ARNs in the Vault role. Optional if the Vault role only allows a single // AWS role ARN; required otherwise. // - `ttl` (string) - Specifies the TTL for the use of the STS token. This // is specified as a string with a duration suffix. Valid only when // credential\_type is assumed\_role or federation\_token. When not // specified, the default\_sts\_ttl set for the role will be used. If that // is also not set, then the default value of 3600s will be used. AWS // places limits on the maximum TTL allowed. See the AWS documentation on // the DurationSeconds parameter for AssumeRole (for assumed\_role // credential types) and GetFederationToken (for federation\_token // credential types) for more details. // // “` json // { // "vault_aws_engine": { // "name": "myrole", // "role_arn": "myarn", // "ttl": "3600s" // } // } // “` VaultAWSEngine VaultAWSEngineOptions `mapstructure:"vault_aws_engine" required:"false"` // contains filtered or unexported fields }
AccessConfig is for common configuration related to AWS access
func (*AccessConfig) GetCredsFromVault ¶ added in v1.3.5
func (c *AccessConfig) GetCredsFromVault() error
func (*AccessConfig) IsChinaCloud ¶ added in v1.2.0
func (c *AccessConfig) IsChinaCloud() bool
func (*AccessConfig) IsGovCloud ¶ added in v1.2.0
func (c *AccessConfig) IsGovCloud() bool
func (*AccessConfig) NewEC2Connection ¶ added in v1.3.2
func (c *AccessConfig) NewEC2Connection() (ec2iface.EC2API, error)
func (*AccessConfig) Prepare ¶
func (c *AccessConfig) Prepare(ctx *interpolate.Context) []error
func (*AccessConfig) Session ¶ added in v1.0.1
func (c *AccessConfig) Session() (*session.Session, error)
Config returns a valid aws.Config object for access to AWS services, or an error if the authentication and region couldn't be resolved
func (*AccessConfig) SessionRegion ¶ added in v1.2.0
func (c *AccessConfig) SessionRegion() string
func (*AccessConfig) ValidateRegion ¶ added in v1.3.2
func (c *AccessConfig) ValidateRegion(regions ...string) error
ValidateRegion returns an nil if the regions are valid and exists; otherwise an error. ValidateRegion calls ec2conn.DescribeRegions to get the list of regions available to this account.
type AmiFilterOptions ¶ added in v0.12.0
type AmiFilterOptions struct { Filters map[string]string Owners []string MostRecent bool `mapstructure:"most_recent"` }
func (*AmiFilterOptions) Empty ¶ added in v0.12.0
func (d *AmiFilterOptions) Empty() bool
func (*AmiFilterOptions) FlatMapstructure ¶ added in v1.4.5
func (*AmiFilterOptions) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec }
FlatMapstructure returns a new FlatAmiFilterOptions. FlatAmiFilterOptions is an auto-generated flat version of AmiFilterOptions. Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.
func (*AmiFilterOptions) GetOwners ¶ added in v1.4.5
func (d *AmiFilterOptions) GetOwners() []*string
func (*AmiFilterOptions) NoOwner ¶ added in v1.3.0
func (d *AmiFilterOptions) NoOwner() bool
type Artifact ¶
type Artifact struct { // A map of regions to AMI IDs. Amis map[string]string // BuilderId is the unique ID for the builder that created this AMI BuilderIdValue string // StateData should store data such as GeneratedData // to be shared with post-processors StateData map[string]interface{} // EC2 connection for performing API stuff. Session *session.Session }
Artifact is an artifact implementation that contains built AMIs.
type BlockDevice ¶ added in v0.3.2
type BlockDevice struct { // Indicates whether the EBS volume is deleted on instance termination. // Default false. NOTE: If this value is not explicitly set to true and // volumes are not cleaned up by an alternative method, additional volumes // will accumulate after every build. DeleteOnTermination bool `mapstructure:"delete_on_termination" required:"false"` // The device name exposed to the instance (for example, /dev/sdh or xvdh). // Required for every device in the block device mapping. DeviceName string `mapstructure:"device_name" required:"false"` // Indicates whether or not to encrypt the volume. By default, Packer will // keep the encryption setting to what it was in the source image. Setting // false will result in an unencrypted device, and true will result in an // encrypted one. Encrypted config.Trilean `mapstructure:"encrypted" required:"false"` // The number of I/O operations per second (IOPS) that the volume supports. // See the documentation on // [IOPs](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_EbsBlockDevice.html) // for more information IOPS int64 `mapstructure:"iops" required:"false"` // Suppresses the specified device included in the block device mapping of // the AMI. NoDevice bool `mapstructure:"no_device" required:"false"` // The ID of the snapshot. SnapshotId string `mapstructure:"snapshot_id" required:"false"` // The virtual device name. See the documentation on Block Device Mapping // for more information. VirtualName string `mapstructure:"virtual_name" required:"false"` // The volume type. gp2 for General Purpose (SSD) volumes, io1 for // Provisioned IOPS (SSD) volumes, st1 for Throughput Optimized HDD, sc1 // for Cold HDD, and standard for Magnetic volumes. VolumeType string `mapstructure:"volume_type" required:"false"` // The size of the volume, in GiB. Required if not specifying a // snapshot_id. VolumeSize int64 `mapstructure:"volume_size" required:"false"` // ID, alias or ARN of the KMS key to use for boot volume encryption. This // only applies to the main region, other regions where the AMI will be // copied will be encrypted by the default EBS KMS key. For valid formats // see KmsKeyId in the [AWS API docs - // CopyImage](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CopyImage.html) // This field is validated by Packer, when using an alias, you will have to // prefix kms_key_id with alias/. KmsKeyId string `mapstructure:"kms_key_id" required:"false"` }
These will be attached when booting a new instance from your AMI. Your options here may vary depending on the type of VM you use.
Example use case:
The following mapping will tell Packer to encrypt the root volume of the build instance at launch using a specific non-default kms key:
``` json
"[{ "device_name": "/dev/sda1", "encrypted": true, "kms_key_id": "1a2b3c4d-5e6f-1a2b-3c4d-5e6f1a2b3c4d" }]
```
Documentation for Block Devices Mappings can be found here: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html
func (BlockDevice) BuildEC2BlockDeviceMapping ¶ added in v1.4.4
func (blockDevice BlockDevice) BuildEC2BlockDeviceMapping() *ec2.BlockDeviceMapping
func (*BlockDevice) FlatMapstructure ¶ added in v1.4.5
func (*BlockDevice) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec }
FlatMapstructure returns a new FlatBlockDevice. FlatBlockDevice is an auto-generated flat version of BlockDevice. Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.
func (*BlockDevice) Prepare ¶ added in v1.2.0
func (b *BlockDevice) Prepare(ctx *interpolate.Context) error
type BlockDevices ¶ added in v0.3.2
type BlockDevices []BlockDevice
func (BlockDevices) BuildEC2BlockDeviceMappings ¶ added in v1.4.4
func (bds BlockDevices) BuildEC2BlockDeviceMappings() []*ec2.BlockDeviceMapping
func (BlockDevices) Prepare ¶ added in v0.7.0
func (bds BlockDevices) Prepare(ctx *interpolate.Context) (errs []error)
type BuildInfoTemplate ¶ added in v0.12.3
type EC2BlockDeviceMappingsBuilder ¶ added in v1.4.4
type EC2BlockDeviceMappingsBuilder interface {
BuildEC2BlockDeviceMappings() []*ec2.BlockDeviceMapping
}
type FlatAmiFilterOptions ¶ added in v1.4.5
type FlatAmiFilterOptions struct { Filters map[string]string `cty:"filters"` Owners []string `cty:"owners"` MostRecent *bool `mapstructure:"most_recent" cty:"most_recent"` }
FlatAmiFilterOptions is an auto-generated flat version of AmiFilterOptions. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.
func (*FlatAmiFilterOptions) HCL2Spec ¶ added in v1.4.5
func (*FlatAmiFilterOptions) HCL2Spec() map[string]hcldec.Spec
HCL2Spec returns the hcl spec of a AmiFilterOptions. This spec is used by HCL to read the fields of AmiFilterOptions. The decoded values from this spec will then be applied to a FlatAmiFilterOptions.
type FlatBlockDevice ¶ added in v1.4.5
type FlatBlockDevice struct { DeleteOnTermination *bool `mapstructure:"delete_on_termination" required:"false" cty:"delete_on_termination"` DeviceName *string `mapstructure:"device_name" required:"false" cty:"device_name"` Encrypted *bool `mapstructure:"encrypted" required:"false" cty:"encrypted"` IOPS *int64 `mapstructure:"iops" required:"false" cty:"iops"` NoDevice *bool `mapstructure:"no_device" required:"false" cty:"no_device"` SnapshotId *string `mapstructure:"snapshot_id" required:"false" cty:"snapshot_id"` VirtualName *string `mapstructure:"virtual_name" required:"false" cty:"virtual_name"` VolumeType *string `mapstructure:"volume_type" required:"false" cty:"volume_type"` VolumeSize *int64 `mapstructure:"volume_size" required:"false" cty:"volume_size"` KmsKeyId *string `mapstructure:"kms_key_id" required:"false" cty:"kms_key_id"` }
FlatBlockDevice is an auto-generated flat version of BlockDevice. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.
type FlatPolicyDocument ¶ added in v1.4.5
type FlatPolicyDocument struct { Version *string `cty:"version"` Statement []FlatStatement `cty:"statement"` }
FlatPolicyDocument is an auto-generated flat version of PolicyDocument. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.
func (*FlatPolicyDocument) HCL2Spec ¶ added in v1.4.5
func (*FlatPolicyDocument) HCL2Spec() map[string]hcldec.Spec
HCL2Spec returns the hcl spec of a PolicyDocument. This spec is used by HCL to read the fields of PolicyDocument. The decoded values from this spec will then be applied to a FlatPolicyDocument.
type FlatSecurityGroupFilterOptions ¶ added in v1.4.5
FlatSecurityGroupFilterOptions is an auto-generated flat version of SecurityGroupFilterOptions. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.
func (*FlatSecurityGroupFilterOptions) HCL2Spec ¶ added in v1.4.5
func (*FlatSecurityGroupFilterOptions) HCL2Spec() map[string]hcldec.Spec
HCL2Spec returns the hcl spec of a SecurityGroupFilterOptions. This spec is used by HCL to read the fields of SecurityGroupFilterOptions. The decoded values from this spec will then be applied to a FlatSecurityGroupFilterOptions.
type FlatStatement ¶ added in v1.4.5
type FlatStatement struct { Effect *string `cty:"effect"` Action []string `cty:"action"` Resource *string `cty:"resource"` }
FlatStatement is an auto-generated flat version of Statement. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.
type FlatSubnetFilterOptions ¶ added in v1.4.5
type FlatSubnetFilterOptions struct { Filters map[string]string `cty:"filters"` MostFree *bool `mapstructure:"most_free" cty:"most_free"` Random *bool `mapstructure:"random" cty:"random"` }
FlatSubnetFilterOptions is an auto-generated flat version of SubnetFilterOptions. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.
func (*FlatSubnetFilterOptions) HCL2Spec ¶ added in v1.4.5
func (*FlatSubnetFilterOptions) HCL2Spec() map[string]hcldec.Spec
HCL2Spec returns the hcl spec of a SubnetFilterOptions. This spec is used by HCL to read the fields of SubnetFilterOptions. The decoded values from this spec will then be applied to a FlatSubnetFilterOptions.
type FlatVaultAWSEngineOptions ¶ added in v1.4.5
type FlatVaultAWSEngineOptions struct { Name *string `mapstructure:"name" cty:"name"` RoleARN *string `mapstructure:"role_arn" cty:"role_arn"` TTL *string `mapstructure:"ttl" required:"false" cty:"ttl"` EngineName *string `mapstructure:"engine_name" cty:"engine_name"` }
FlatVaultAWSEngineOptions is an auto-generated flat version of VaultAWSEngineOptions. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.
func (*FlatVaultAWSEngineOptions) HCL2Spec ¶ added in v1.4.5
func (*FlatVaultAWSEngineOptions) HCL2Spec() map[string]hcldec.Spec
HCL2Spec returns the hcl spec of a VaultAWSEngineOptions. This spec is used by HCL to read the fields of VaultAWSEngineOptions. The decoded values from this spec will then be applied to a FlatVaultAWSEngineOptions.
type FlatVpcFilterOptions ¶ added in v1.4.5
FlatVpcFilterOptions is an auto-generated flat version of VpcFilterOptions. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.
func (*FlatVpcFilterOptions) HCL2Spec ¶ added in v1.4.5
func (*FlatVpcFilterOptions) HCL2Spec() map[string]hcldec.Spec
HCL2Spec returns the hcl spec of a VpcFilterOptions. This spec is used by HCL to read the fields of VpcFilterOptions. The decoded values from this spec will then be applied to a FlatVpcFilterOptions.
type PolicyDocument ¶ added in v1.4.5
func (*PolicyDocument) FlatMapstructure ¶ added in v1.4.5
func (*PolicyDocument) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec }
FlatMapstructure returns a new FlatPolicyDocument. FlatPolicyDocument is an auto-generated flat version of PolicyDocument. Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.
type RunConfig ¶
type RunConfig struct { // If using a non-default VPC, // public IP addresses are not provided by default. If this is true, your // new instance will get a Public IP. default: false AssociatePublicIpAddress bool `mapstructure:"associate_public_ip_address" required:"false"` // Destination availability zone to launch // instance in. Leave this empty to allow Amazon to auto-assign. AvailabilityZone string `mapstructure:"availability_zone" required:"false"` // Requires spot_price to be set. The // required duration for the Spot Instances (also known as Spot blocks). This // value must be a multiple of 60 (60, 120, 180, 240, 300, or 360). You can't // specify an Availability Zone group or a launch group if you specify a // duration. BlockDurationMinutes int64 `mapstructure:"block_duration_minutes" required:"false"` // Packer normally stops the build instance after all provisioners have // run. For Windows instances, it is sometimes desirable to [run // Sysprep](http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ami-create-standard.html) // which will stop the instance for you. If this is set to `true`, Packer // *will not* stop the instance but will assume that you will send the stop // signal yourself through your final provisioner. You can do this with a // [windows-shell // provisioner](https://www.packer.io/docs/provisioners/windows-shell.html). // Note that Packer will still wait for the instance to be stopped, and // failing to send the stop signal yourself, when you have set this flag to // `true`, will cause a timeout. // Example of a valid shutdown command: // // “` json // { // "type": "windows-shell", // "inline": ["\"c:\\Program Files\\Amazon\\Ec2ConfigService\\ec2config.exe\" -sysprep"] // } // “` DisableStopInstance bool `mapstructure:"disable_stop_instance" required:"false"` // Mark instance as [EBS // Optimized](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSOptimized.html). // Default `false`. EbsOptimized bool `mapstructure:"ebs_optimized" required:"false"` // Enabling T2 Unlimited allows the source instance to burst additional CPU // beyond its available [CPU // Credits](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/t2-credits-baseline-concepts.html) // for as long as the demand exists. This is in contrast to the standard // configuration that only allows an instance to consume up to its // available CPU Credits. See the AWS documentation for [T2 // Unlimited](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/t2-unlimited.html) // and the **T2 Unlimited Pricing** section of the [Amazon EC2 On-Demand // Pricing](https://aws.amazon.com/ec2/pricing/on-demand/) document for // more information. By default this option is disabled and Packer will set // up a [T2 // Standard](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/t2-std.html) // instance instead. // // To use T2 Unlimited you must use a T2 instance type, e.g. `t2.micro`. // Additionally, T2 Unlimited cannot be used in conjunction with Spot // Instances, e.g. when the `spot_price` option has been configured. // Attempting to do so will cause an error. // // !> **Warning!** Additional costs may be incurred by enabling T2 // Unlimited - even for instances that would usually qualify for the // [AWS Free Tier](https://aws.amazon.com/free/). EnableT2Unlimited bool `mapstructure:"enable_t2_unlimited" required:"false"` // The name of an [IAM instance // profile](https://docs.aws.amazon.com/IAM/latest/UserGuide/instance-profiles.html) // to launch the EC2 instance with. IamInstanceProfile string `mapstructure:"iam_instance_profile" required:"false"` // Whether or not to check if the IAM instance profile exists. Defaults to false SkipProfileValidation bool `mapstructure:"skip_profile_validation" required:"false"` // Temporary IAM instance profile policy document // If IamInstanceProfile is specified it will be used instead. Example: // // “`json //{ // "Version": "2012-10-17", // "Statement": [ // { // "Action": [ // "logs:*" // ], // "Effect": "Allow", // "Resource": "*" // } // ] //} // “` // TemporaryIamInstanceProfilePolicyDocument *PolicyDocument `mapstructure:"temporary_iam_instance_profile_policy_document" required:"false"` // Automatically terminate instances on // shutdown in case Packer exits ungracefully. Possible values are stop and // terminate. Defaults to stop. InstanceInitiatedShutdownBehavior string `mapstructure:"shutdown_behavior" required:"false"` // The EC2 instance type to use while building the // AMI, such as t2.small. InstanceType string `mapstructure:"instance_type" required:"true"` // Filters used to populate the `security_group_ids` field. Example: // // “` json // { // "security_group_filter": { // "filters": { // "tag:Class": "packer" // } // } // } // “` // // This selects the SG's with tag `Class` with the value `packer`. // // - `filters` (map of strings) - filters used to select a // `security_group_ids`. Any filter described in the docs for // [DescribeSecurityGroups](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSecurityGroups.html) // is valid. // // `security_group_ids` take precedence over this. SecurityGroupFilter SecurityGroupFilterOptions `mapstructure:"security_group_filter" required:"false"` // Tags to apply to the instance that is that is *launched* to create the // EBS volumes. This is a [template engine](/docs/templates/engine.html), // see [Build template data](#build-template-data) for more information. RunTags map[string]string `mapstructure:"run_tags" required:"false"` // The ID (not the name) of the security // group to assign to the instance. By default this is not set and Packer will // automatically create a new temporary security group to allow SSH access. // Note that if this is specified, you must be sure the security group allows // access to the ssh_port given below. SecurityGroupId string `mapstructure:"security_group_id" required:"false"` // A list of security groups as // described above. Note that if this is specified, you must omit the // security_group_id. SecurityGroupIds []string `mapstructure:"security_group_ids" required:"false"` // The source AMI whose root volume will be copied and // provisioned on the currently running instance. This must be an EBS-backed // AMI with a root volume snapshot that you have access to. Note: this is not // used when from_scratch is set to true. SourceAmi string `mapstructure:"source_ami" required:"true"` // Filters used to populate the `source_ami` // field. Example: // // “` json // { // "source_ami_filter": { // "filters": { // "virtualization-type": "hvm", // "name": "ubuntu/images/\*ubuntu-xenial-16.04-amd64-server-\*", // "root-device-type": "ebs" // }, // "owners": ["099720109477"], // "most_recent": true // } // } // “` // // This selects the most recent Ubuntu 16.04 HVM EBS AMI from Canonical. NOTE: // This will fail unless *exactly* one AMI is returned. In the above example, // `most_recent` will cause this to succeed by selecting the newest image. // // - `filters` (map of strings) - filters used to select a `source_ami`. // NOTE: This will fail unless *exactly* one AMI is returned. Any filter // described in the docs for // [DescribeImages](http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeImages.html) // is valid. // // - `owners` (array of strings) - Filters the images by their owner. You // may specify one or more AWS account IDs, "self" (which will use the // account whose credentials you are using to run Packer), or an AWS owner // alias: for example, `amazon`, `aws-marketplace`, or `microsoft`. This // option is required for security reasons. // // - `most_recent` (boolean) - Selects the newest created image when true. // This is most useful for selecting a daily distro build. // // You may set this in place of `source_ami` or in conjunction with it. If you // set this in conjunction with `source_ami`, the `source_ami` will be added // to the filter. The provided `source_ami` must meet all of the filtering // criteria provided in `source_ami_filter`; this pins the AMI returned by the // filter, but will cause Packer to fail if the `source_ami` does not exist. SourceAmiFilter AmiFilterOptions `mapstructure:"source_ami_filter" required:"false"` // a list of acceptable instance // types to run your build on. We will request a spot instance using the max // price of spot_price and the allocation strategy of "lowest price". // Your instance will be launched on an instance type of the lowest available // price that you have in your list. This is used in place of instance_type. // You may only set either spot_instance_types or instance_type, not both. // This feature exists to help prevent situations where a Packer build fails // because a particular availability zone does not have capacity for the // specific instance_type requested in instance_type. SpotInstanceTypes []string `mapstructure:"spot_instance_types" required:"false"` // The maximum hourly price to pay for a spot instance // to create the AMI. Spot instances are a type of instance that EC2 starts // when the current spot price is less than the maximum price you specify. // Spot price will be updated based on available spot instance capacity and // current spot instance requests. It may save you some costs. You can set // this to auto for Packer to automatically discover the best spot price or // to "0" to use an on demand instance (default). SpotPrice string `mapstructure:"spot_price" required:"false"` // Required if spot_price is set to // auto. This tells Packer what sort of AMI you're launching to find the // best spot price. This must be one of: Linux/UNIX, SUSE Linux, // Windows, Linux/UNIX (Amazon VPC), SUSE Linux (Amazon VPC), // Windows (Amazon VPC) SpotPriceAutoProduct string `mapstructure:"spot_price_auto_product" required:"false"` // Requires spot_price to be // set. This tells Packer to apply tags to the spot request that is issued. SpotTags map[string]string `mapstructure:"spot_tags" required:"false"` // Filters used to populate the `subnet_id` field. // Example: // // “` json // { // "subnet_filter": { // "filters": { // "tag:Class": "build" // }, // "most_free": true, // "random": false // } // } // “` // // This selects the Subnet with tag `Class` with the value `build`, which has // the most free IP addresses. NOTE: This will fail unless *exactly* one // Subnet is returned. By using `most_free` or `random` one will be selected // from those matching the filter. // // - `filters` (map of strings) - filters used to select a `subnet_id`. // NOTE: This will fail unless *exactly* one Subnet is returned. Any // filter described in the docs for // [DescribeSubnets](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSubnets.html) // is valid. // // - `most_free` (boolean) - The Subnet with the most free IPv4 addresses // will be used if multiple Subnets matches the filter. // // - `random` (boolean) - A random Subnet will be used if multiple Subnets // matches the filter. `most_free` have precendence over this. // // `subnet_id` take precedence over this. SubnetFilter SubnetFilterOptions `mapstructure:"subnet_filter" required:"false"` // If using VPC, the ID of the subnet, such as // subnet-12345def, where Packer will launch the EC2 instance. This field is // required if you are using an non-default VPC. SubnetId string `mapstructure:"subnet_id" required:"false"` // The name of the temporary key pair to // generate. By default, Packer generates a name that looks like // `packer_<UUID>`, where <UUID> is a 36 character unique identifier. TemporaryKeyPairName string `mapstructure:"temporary_key_pair_name" required:"false"` // A list of IPv4 CIDR blocks to be authorized access to the instance, when // packer is creating a temporary security group. // // The default is [`0.0.0.0/0`] (i.e., allow any IPv4 source). This is only // used when `security_group_id` or `security_group_ids` is not specified. TemporarySGSourceCidrs []string `mapstructure:"temporary_security_group_source_cidrs" required:"false"` // User data to apply when launching the instance. Note // that you need to be careful about escaping characters due to the templates // being JSON. It is often more convenient to use user_data_file, instead. // Packer will not automatically wait for a user script to finish before // shutting down the instance this must be handled in a provisioner. UserData string `mapstructure:"user_data" required:"false"` // Path to a file that will be used for the user // data when launching the instance. UserDataFile string `mapstructure:"user_data_file" required:"false"` // Filters used to populate the `vpc_id` field. // Example: // // “` json // { // "vpc_filter": { // "filters": { // "tag:Class": "build", // "isDefault": "false", // "cidr": "/24" // } // } // } // “` // // This selects the VPC with tag `Class` with the value `build`, which is not // the default VPC, and have a IPv4 CIDR block of `/24`. NOTE: This will fail // unless *exactly* one VPC is returned. // // - `filters` (map of strings) - filters used to select a `vpc_id`. NOTE: // This will fail unless *exactly* one VPC is returned. Any filter // described in the docs for // [DescribeVpcs](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpcs.html) // is valid. // // `vpc_id` take precedence over this. VpcFilter VpcFilterOptions `mapstructure:"vpc_filter" required:"false"` // If launching into a VPC subnet, Packer needs the VPC ID // in order to create a temporary security group within the VPC. Requires // subnet_id to be set. If this field is left blank, Packer will try to get // the VPC ID from the subnet_id. VpcId string `mapstructure:"vpc_id" required:"false"` // The timeout for waiting for a Windows // password for Windows instances. Defaults to 20 minutes. Example value: // 10m WindowsPasswordTimeout time.Duration `mapstructure:"windows_password_timeout" required:"false"` // Communicator settings Comm communicator.Config `mapstructure:",squash"` // One of `public_ip`, `private_ip`, `public_dns`, or `private_dns`. If // set, either the public IP address, private IP address, public DNS name // or private DNS name will be used as the host for SSH. The default behaviour // if inside a VPC is to use the public IP address if available, otherwise // the private IP address will be used. If not in a VPC the public DNS name // will be used. Also works for WinRM. // // Where Packer is configured for an outbound proxy but WinRM traffic // should be direct, `ssh_interface` must be set to `private_dns` and // `<region>.compute.internal` included in the `NO_PROXY` environment // variable. SSHInterface string `mapstructure:"ssh_interface"` }
RunConfig contains configuration for running an instance from a source AMI and details on how to access that launched image.
func (*RunConfig) IsSpotInstance ¶ added in v1.1.3
type SecurityGroupFilterOptions ¶ added in v1.3.2
func (*SecurityGroupFilterOptions) Empty ¶ added in v1.3.2
func (d *SecurityGroupFilterOptions) Empty() bool
func (*SecurityGroupFilterOptions) FlatMapstructure ¶ added in v1.4.5
func (*SecurityGroupFilterOptions) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec }
FlatMapstructure returns a new FlatSecurityGroupFilterOptions. FlatSecurityGroupFilterOptions is an auto-generated flat version of SecurityGroupFilterOptions. Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.
type StateChangeConf ¶
type StateChangeConf struct { Pending []string Refresh StateRefreshFunc StepState multistep.StateBag Target string }
StateChangeConf is the configuration struct used for `WaitForState`.
type StateRefreshFunc ¶ added in v0.2.3
StateRefreshFunc is a function type used for StateChangeConf that is responsible for refreshing the item being watched for a state change.
It returns three results. `result` is any object that will be returned as the final object after waiting for state change. This allows you to return the final updated object, for example an EC2 instance after refreshing it.
`state` is the latest state of that object. And `err` is any error that may have happened while refreshing the state.
type Statement ¶ added in v1.4.5
func (*Statement) FlatMapstructure ¶ added in v1.4.5
FlatMapstructure returns a new FlatStatement. FlatStatement is an auto-generated flat version of Statement. Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.
type StepAMIRegionCopy ¶ added in v0.3.5
type StepAMIRegionCopy struct { AccessConfig *AccessConfig Regions []string AMIKmsKeyId string RegionKeyIds map[string]string EncryptBootVolume config.Trilean // nil means preserve Name string OriginalRegion string AMISkipBuildRegion bool // contains filtered or unexported fields }
func (*StepAMIRegionCopy) Cleanup ¶ added in v0.3.5
func (s *StepAMIRegionCopy) Cleanup(state multistep.StateBag)
func (*StepAMIRegionCopy) DeduplicateRegions ¶ added in v1.4.3
func (s *StepAMIRegionCopy) DeduplicateRegions(intermediary bool)
func (*StepAMIRegionCopy) Run ¶ added in v0.3.5
func (s *StepAMIRegionCopy) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepCleanupVolumes ¶ added in v1.3.0
type StepCleanupVolumes struct {
LaunchMappings BlockDevices
}
stepCleanupVolumes cleans up any orphaned volumes that were not designated to remain after termination of the instance. These volumes are typically ones that are marked as "delete on terminate:false" in the source_ami of a build.
func (*StepCleanupVolumes) Cleanup ¶ added in v1.3.0
func (s *StepCleanupVolumes) Cleanup(state multistep.StateBag)
func (*StepCleanupVolumes) Run ¶ added in v1.3.0
func (s *StepCleanupVolumes) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepCreateTags ¶ added in v0.2.3
type StepCreateTags struct { Tags TagMap SnapshotTags TagMap Ctx interpolate.Context }
func (*StepCreateTags) Cleanup ¶ added in v0.2.3
func (s *StepCreateTags) Cleanup(state multistep.StateBag)
func (*StepCreateTags) Run ¶ added in v0.2.3
func (s *StepCreateTags) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepDeregisterAMI ¶ added in v0.8.0
type StepDeregisterAMI struct { AccessConfig *AccessConfig ForceDeregister bool ForceDeleteSnapshot bool AMIName string Regions []string }
func (*StepDeregisterAMI) Cleanup ¶ added in v0.8.0
func (s *StepDeregisterAMI) Cleanup(state multistep.StateBag)
func (*StepDeregisterAMI) Run ¶ added in v0.8.0
func (s *StepDeregisterAMI) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepGetPassword ¶ added in v0.8.0
type StepGetPassword struct { Debug bool Comm *communicator.Config Timeout time.Duration BuildName string }
StepGetPassword reads the password from a Windows server and sets it on the WinRM config.
func (*StepGetPassword) Cleanup ¶ added in v0.8.0
func (s *StepGetPassword) Cleanup(multistep.StateBag)
func (*StepGetPassword) Run ¶ added in v0.8.0
func (s *StepGetPassword) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepIamInstanceProfile ¶ added in v1.4.5
type StepIamInstanceProfile struct { IamInstanceProfile string SkipProfileValidation bool TemporaryIamInstanceProfilePolicyDocument *PolicyDocument // contains filtered or unexported fields }
func (*StepIamInstanceProfile) Cleanup ¶ added in v1.4.5
func (s *StepIamInstanceProfile) Cleanup(state multistep.StateBag)
func (*StepIamInstanceProfile) Run ¶ added in v1.4.5
func (s *StepIamInstanceProfile) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepKeyPair ¶
type StepKeyPair struct { Debug bool Comm *communicator.Config DebugKeyPath string // contains filtered or unexported fields }
func (*StepKeyPair) Cleanup ¶
func (s *StepKeyPair) Cleanup(state multistep.StateBag)
func (*StepKeyPair) Run ¶
func (s *StepKeyPair) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepModifyAMIAttributes ¶ added in v0.3.0
type StepModifyAMIAttributes struct { Users []string Groups []string SnapshotUsers []string SnapshotGroups []string ProductCodes []string Description string Ctx interpolate.Context GeneratedData *builder.GeneratedData }
func (*StepModifyAMIAttributes) Cleanup ¶ added in v0.3.0
func (s *StepModifyAMIAttributes) Cleanup(state multistep.StateBag)
func (*StepModifyAMIAttributes) Run ¶ added in v0.3.0
func (s *StepModifyAMIAttributes) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepModifyEBSBackedInstance ¶ added in v0.12.0
type StepModifyEBSBackedInstance struct { Skip bool EnableAMIENASupport confighelper.Trilean EnableAMISriovNetSupport bool }
func (*StepModifyEBSBackedInstance) Cleanup ¶ added in v0.12.0
func (s *StepModifyEBSBackedInstance) Cleanup(state multistep.StateBag)
func (*StepModifyEBSBackedInstance) Run ¶ added in v0.12.0
func (s *StepModifyEBSBackedInstance) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepNetworkInfo ¶ added in v1.3.2
type StepNetworkInfo struct { VpcId string VpcFilter VpcFilterOptions SubnetId string SubnetFilter SubnetFilterOptions AvailabilityZone string SecurityGroupIds []string SecurityGroupFilter SecurityGroupFilterOptions }
StepNetworkInfo queries AWS for information about VPC's and Subnets that is used throughout the AMI creation process.
Produces (adding them to the state bag):
vpc_id string - the VPC ID subnet_id string - the Subnet ID availability_zone string - the AZ name
func (*StepNetworkInfo) Cleanup ¶ added in v1.3.2
func (s *StepNetworkInfo) Cleanup(multistep.StateBag)
func (*StepNetworkInfo) Run ¶ added in v1.3.2
func (s *StepNetworkInfo) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepPreValidate ¶ added in v0.8.0
type StepPreValidate struct { DestAmiName string ForceDeregister bool AMISkipBuildRegion bool VpcId string SubnetId string HasSubnetFilter bool }
StepPreValidate provides an opportunity to pre-validate any configuration for the build before actually doing any time consuming work
func (*StepPreValidate) Cleanup ¶ added in v0.8.0
func (s *StepPreValidate) Cleanup(multistep.StateBag)
Cleanup ...
func (*StepPreValidate) Run ¶ added in v0.8.0
func (s *StepPreValidate) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepRunSourceInstance ¶
type StepRunSourceInstance struct { AssociatePublicIpAddress bool LaunchMappings EC2BlockDeviceMappingsBuilder Comm *communicator.Config Ctx interpolate.Context Debug bool EbsOptimized bool EnableT2Unlimited bool ExpectedRootDevice string InstanceInitiatedShutdownBehavior string InstanceType string IsRestricted bool SourceAMI string Tags TagMap UserData string UserDataFile string VolumeTags TagMap NoEphemeral bool // contains filtered or unexported fields }
func (*StepRunSourceInstance) Cleanup ¶
func (s *StepRunSourceInstance) Cleanup(state multistep.StateBag)
func (*StepRunSourceInstance) Run ¶
func (s *StepRunSourceInstance) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepRunSpotInstance ¶ added in v1.1.1
type StepRunSpotInstance struct { AssociatePublicIpAddress bool LaunchMappings EC2BlockDeviceMappingsBuilder BlockDurationMinutes int64 Debug bool Comm *communicator.Config EbsOptimized bool ExpectedRootDevice string InstanceInitiatedShutdownBehavior string InstanceType string SourceAMI string SpotPrice string SpotTags TagMap SpotInstanceTypes []string Tags TagMap VolumeTags TagMap UserData string UserDataFile string Ctx interpolate.Context NoEphemeral bool // contains filtered or unexported fields }
func (*StepRunSpotInstance) Cleanup ¶ added in v1.1.1
func (s *StepRunSpotInstance) Cleanup(state multistep.StateBag)
func (*StepRunSpotInstance) CreateTemplateData ¶ added in v1.4.2
func (s *StepRunSpotInstance) CreateTemplateData(userData *string, az string, state multistep.StateBag, marketOptions *ec2.LaunchTemplateInstanceMarketOptionsRequest) *ec2.RequestLaunchTemplateData
func (*StepRunSpotInstance) LoadUserData ¶ added in v1.4.2
func (s *StepRunSpotInstance) LoadUserData() (string, error)
func (*StepRunSpotInstance) Run ¶ added in v1.1.1
func (s *StepRunSpotInstance) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepSecurityGroup ¶
type StepSecurityGroup struct { CommConfig *communicator.Config SecurityGroupFilter SecurityGroupFilterOptions SecurityGroupIds []string TemporarySGSourceCidrs []string // contains filtered or unexported fields }
func (*StepSecurityGroup) Cleanup ¶
func (s *StepSecurityGroup) Cleanup(state multistep.StateBag)
func (*StepSecurityGroup) Run ¶
func (s *StepSecurityGroup) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepSourceAMIInfo ¶ added in v0.6.1
type StepSourceAMIInfo struct { SourceAmi string EnableAMISriovNetSupport bool EnableAMIENASupport confighelper.Trilean AMIVirtType string AmiFilters AmiFilterOptions }
StepSourceAMIInfo extracts critical information from the source AMI that is used throughout the AMI creation process.
Produces:
source_image *ec2.Image - the source AMI info
func (*StepSourceAMIInfo) Cleanup ¶ added in v0.6.1
func (s *StepSourceAMIInfo) Cleanup(multistep.StateBag)
func (*StepSourceAMIInfo) Run ¶ added in v0.6.1
func (s *StepSourceAMIInfo) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepStopEBSBackedInstance ¶ added in v0.12.0
func (*StepStopEBSBackedInstance) Cleanup ¶ added in v0.12.0
func (s *StepStopEBSBackedInstance) Cleanup(multistep.StateBag)
func (*StepStopEBSBackedInstance) Run ¶ added in v0.12.0
func (s *StepStopEBSBackedInstance) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type SubnetFilterOptions ¶ added in v1.3.2
type SubnetFilterOptions struct { Filters map[string]string MostFree bool `mapstructure:"most_free"` Random bool `mapstructure:"random"` }
func (*SubnetFilterOptions) Empty ¶ added in v1.3.2
func (d *SubnetFilterOptions) Empty() bool
func (*SubnetFilterOptions) FlatMapstructure ¶ added in v1.4.5
func (*SubnetFilterOptions) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec }
FlatMapstructure returns a new FlatSubnetFilterOptions. FlatSubnetFilterOptions is an auto-generated flat version of SubnetFilterOptions. Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.
type VaultAWSEngineOptions ¶ added in v1.3.5
type VaultAWSEngineOptions struct { Name string `mapstructure:"name"` RoleARN string `mapstructure:"role_arn"` // Specifies the TTL for the use of the STS token. This // is specified as a string with a duration suffix. Valid only when // credential_type is assumed_role or federation_token. When not // specified, the default_sts_ttl set for the role will be used. If that // is also not set, then the default value of 3600s will be used. AWS // places limits on the maximum TTL allowed. See the AWS documentation on // the DurationSeconds parameter for AssumeRole (for assumed_role // credential types) and GetFederationToken (for federation_token // credential types) for more details. TTL string `mapstructure:"ttl" required:"false"` EngineName string `mapstructure:"engine_name"` }
func (*VaultAWSEngineOptions) Empty ¶ added in v1.3.5
func (v *VaultAWSEngineOptions) Empty() bool
func (*VaultAWSEngineOptions) FlatMapstructure ¶ added in v1.4.5
func (*VaultAWSEngineOptions) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec }
FlatMapstructure returns a new FlatVaultAWSEngineOptions. FlatVaultAWSEngineOptions is an auto-generated flat version of VaultAWSEngineOptions. Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.
type VpcFilterOptions ¶ added in v1.3.2
func (*VpcFilterOptions) Empty ¶ added in v1.3.2
func (d *VpcFilterOptions) Empty() bool
func (*VpcFilterOptions) FlatMapstructure ¶ added in v1.4.5
func (*VpcFilterOptions) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec }
FlatMapstructure returns a new FlatVpcFilterOptions. FlatVpcFilterOptions is an auto-generated flat version of VpcFilterOptions. Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.
Source Files
¶
- access_config.go
- access_config.hcl2spec.go
- ami_config.go
- artifact.go
- block_device.go
- block_device.hcl2spec.go
- build_filter.go
- errors.go
- helper_funcs.go
- interpolate_build_info.go
- regions.go
- run_config.go
- run_config.hcl2spec.go
- ssh.go
- state.go
- step_ami_region_copy.go
- step_cleanup_volumes.go
- step_create_tags.go
- step_deregister_ami.go
- step_get_password.go
- step_iam_instance_profile.go
- step_key_pair.go
- step_modify_ami_attributes.go
- step_modify_ebs_instance.go
- step_network_info.go
- step_pre_validate.go
- step_run_source_instance.go
- step_run_spot_instance.go
- step_security_group.go
- step_source_ami_info.go
- step_stop_ebs_instance.go
- tags.go
- template_funcs.go