< Back

Connect-AppVeyorToAWS

Fri Jan 10, 2020 8:28 pm

NAME Connect-AppVeyorToAWS



SYNOPSIS

Command to enable AWS builds. Works with both hosted AppVeyor and AppVeyor Server.





SYNTAX

Connect-AppVeyorToAWS [-AppVeyorUrl] <String> [-ApiToken] <String> [[-AccessKeyId] <String>] [[-SecretAccessKey]

<String>] [-SkipDisclaimer] [[-Region] <String>] [[-InstanceSize] <String>] [[-SubnetId] <String>] [[-AmiId]

<String>] [[-CommonPrefix] <String>] [[-ImageOs] <String>] [[-ImageName] <String>] [[-ImageTemplate] <String>]

[[-ImageFeatures] <String>] [[-ImageCustomScript] <String>] [[-ImageCustomScriptAfterReboot] <String>]

[<CommonParameters>]





DESCRIPTION

You can connect your AppVeyor account (on both hosted AppVeyor and on-premise AppVeyor Server) to your own AWS

account for AppVeyor to instantiate build VMs in it. There are several benefits like having the ability to

customize your build image, select desired VM size, set custom build timeout and many others. To simplify the

setup process for you, command provisions necessary AWS resources, runs Hashicorp Packer to create a basic build

image, and puts all the AppVeyor configuration together. After running this command, you should be able to start

builds on AWS immediately (and optionally customize your AWS build environment later).





PARAMETERS

-AppVeyorUrl <String>

AppVeyor URL. For hosted AppVeyor it is https://ci.appveyor.com. For Appveyor Server users it is URL of

on-premise AppVeyor Server installation



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ApiToken <String>

API key for specific account (not 'All accounts'). Hosted AppVeyor users can find it at

https://ci.appveyor.com/api-keys. Appveyor Server users can find it at <appveyor_server_url>/api-keys.



Required? true

Position? 2

Default value

Accept pipeline input? false

Accept wildcard characters? false



-AccessKeyId <String>

AWS Access Key ID to be used both by Packer to create an AMI and by AppVeyor to create required AWS resources

and provision build VMs.



Required? false

Position? 3

Default value

Accept pipeline input? false

Accept wildcard characters? false



-SecretAccessKey <String>

AWS Secret Access Key to be used both by Packer to create an AMI and by AppVeyor to create required AWS

resources and provision build VMs.

Note: later you can replace those credentials with Role ARN to assume in AppVeyor settings for your AWS build

environment.



Required? false

Position? 4

Default value

Accept pipeline input? false

Accept wildcard characters? false



-SkipDisclaimer [<SwitchParameter>]

Skip warning related to AWS resources creation and potential charges. It is recommended to read the warning at

least once, but it can come handy if you need to re-run the command.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-Region <String>

AWS region where you want the command to create a build worker AMI and all additional required resources.

Also, AppVeyor will create build VMs in this location. Use short notation (not display name) e.g. 'us-east-1',

not 'US East (Virginia)'.



Required? false

Position? 5

Default value

Accept pipeline input? false

Accept wildcard characters? false



-InstanceSize <String>

Type of EC2 instance, e.g. 'm4.large'



Required? false

Position? 6

Default value

Accept pipeline input? false

Accept wildcard characters? false



-SubnetId <String>

Subnet ID for a subnet where build VMs will be created.



Required? false

Position? 7

Default value

Accept pipeline input? false

Accept wildcard characters? false



-AmiId <String>

It may be that you run the command, and it creates a valid AMI, but some AppVeyor settings are not set

correctly (or you may just want to change them without doing it in the AppVeyor build environments UI). In

this case you want to skip the most time consuming step (creating an AMI) and pass the existing AMI ID to this

parameter.



Required? false

Position? 8

Default value

Accept pipeline input? false

Accept wildcard characters? false



-CommonPrefix <String>

Command will prepend all created AWS resources names with it. Because of storage account names restrictions,

is must contain only letters and numbers and be shorter than 16 symbols. Default value is 'appveyor'.



Required? false

Position? 9

Default value appveyor

Accept pipeline input? false

Accept wildcard characters? false



-ImageOs <String>

Operating system of build VM image. Valid values: 'Windows', 'Linux'. Default value is 'Windows'.



Required? false

Position? 10

Default value Windows

Accept pipeline input? false

Accept wildcard characters? false



-ImageName <String>

Description to be passed to Packer and name to be used for AppVeyor image. Default value generated is based on

the value of 'ImageOs' parameter.



Required? false

Position? 11

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ImageTemplate <String>

If you are familiar with Hashicorp Packer, you can replace template used by this command with another one.

Default value generated is based on the value of 'ImageOs' parameter.



Required? false

Position? 12

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ImageFeatures <String>

Comma-separated list of feature IDs to be installed on the image. Available IDs can be found at

https://github.com/appveyor/build-image ... adata.json under

'installedFeatures'.



Required? false

Position? 13

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ImageCustomScript <String>

Base-64 encoded text of custom sript to execute during image creation. It should not contain reboot

instructions.



Required? false

Position? 14

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ImageCustomScriptAfterReboot <String>

Base-64 encoded text of custom sript to execute during image creation, after reboot. It is usefull for cases

when custom software being installed with 'ImageCustomScript' required some additional action after computer

restarted.



Required? false

Position? 15

Default value

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Connect-AppVeyorToAWS



Let command collect all required information









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>Connect-AppVeyorToAWS -AppVeyorUrl "https://ci.appveyor.com" -ApiToken XXXXXXXXXXXXXXXXXXXXX -AccessKeyId

XXXXXXXXXXXXXXXXXXXX -SecretAccessKey XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -SkipDisclaimer -Region us-east-1

-InstanceSize m4.large -aws_subnet subnet-xxxxxxxx



Run command with all required parameters so command will ask no questions. It will create resources in AWS US East

(Virginia) region and will connect it to hosted AppVeyor.











RELATED LINKS