generators/aws-containers/prompts.js
function askVPC() {
    if (this.abort) return null;
    const done = this.async();

    const vpcList = this.awsFacts.availableVpcs.map(vpc => {
        const friendlyName = _getFriendlyNameFromTag(vpc);
        return {
            name: `ID: ${vpc.VpcId} (${friendlyName ? `name: '${friendlyName}', ` : ''}default: ${vpc.IsDefault}, state: ${vpc.State})`,
            value: vpc.VpcId,
            short: vpc.VpcId
        };
    });

    const prompts = [
        {
            type: 'list',
            name: 'targetVPC',
            message: 'Please select your target Virtual Private Network.',
            choices: vpcList,
            default: this.aws.vpc.id
        }
    ];

    return this.prompt(prompts).then(props => {
        const targetVPC = props.targetVPC;
        if (targetVPC) {
            this.aws.vpc.id = targetVPC;
            this.aws.vpc.cidr = _.find(this.awsFacts.availableVpcs, ['VpcId', targetVPC]).CidrBlock;
            done();
        } else {
            this.abort = true;
            done();
        }
    });
}
function askVPC() {
    if (this.abort) return null;
    const done = this.async();

    const vpcList = this.awsFacts.availableVpcs.map(vpc => {
        const friendlyName = _getFriendlyNameFromTag(vpc);
        return {
            name: `ID: ${vpc.VpcId} (${friendlyName ? `name: '${friendlyName}', ` : ''}default: ${vpc.IsDefault}, state: ${vpc.State})`,
            value: vpc.VpcId,
            short: vpc.VpcId
        };
    });

    const prompts = [
        {
            type: 'list',
            name: 'targetVPC',
            message: 'Please select your target Virtual Private Network.',
            choices: vpcList,
            default: this.aws.vpc.id
        }
    ];

    return this.prompt(prompts).then(props => {
        const targetVPC = props.targetVPC;
        if (targetVPC) {
            this.aws.vpc.id = targetVPC;
            this.aws.vpc.cidr = _.find(this.awsFacts.availableVpcs, ['VpcId', targetVPC]).CidrBlock;
            done();
        } else {
            this.abort = true;
            done();
        }
    });
}
function askVPC ( ) { if ( this . abort ) return null ; const done = this . async ( ) ; const vpcList = this . awsFacts . availableVpcs . map ( vpc => { const friendlyName = _getFriendlyNameFromTag ( vpc ) ; return { name : ` ${ vpc . VpcId } ${ friendlyName ? ` ${ friendlyName } ` : '' } ${ vpc . IsDefault } ${ vpc . State } ` , value : vpc . VpcId , short : vpc . VpcId } ; } ) ; const prompts = [ { type : 'list' , name : 'targetVPC' , message : 'Please select your target Virtual Private Network.' , choices : vpcList , default : this . aws . vpc . id } ] ; return this . prompt ( prompts ) . then ( props => { const targetVPC = props . targetVPC ; if ( targetVPC ) { this . aws . vpc . id = targetVPC ; this . aws . vpc . cidr = _ . find ( this . awsFacts . availableVpcs , [ 'VpcId' , targetVPC ] ) . CidrBlock ; done ( ) ; } else { this . abort = true ; done ( ) ; } } ) ; }
Ask user to select target Virtual Private Network
Ask user to select target Virtual Private Network