Documentation
¶
Overview ¶
* Copyright 2016 Adobe Systems Incorporated. All rights reserved. * This file is licensed to you under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. You may obtain a copy * of the License at http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS * OF ANY KIND, either express or implied. See the License for the specific language * governing permissions and limitations under the License.
* Copyright 2016 Adobe Systems Incorporated. All rights reserved. * This file is licensed to you under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. You may obtain a copy * of the License at http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS * OF ANY KIND, either express or implied. See the License for the specific language * governing permissions and limitations under the License.
* Copyright 2016 Adobe Systems Incorporated. All rights reserved. * This file is licensed to you under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. You may obtain a copy * of the License at http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS * OF ANY KIND, either express or implied. See the License for the specific language * governing permissions and limitations under the License.
Index ¶
- func AWSCloudFormationInit(autoScalingLaunchConfigurationLogicalId string, ...) (map[string]interface{}, error)
- func ELBToInstance(vpc, https bool, elbName, elbSecurityGroup string) map[string]interface{}
- func ImageIdInMap(mapId string) map[string]interface{}
- func InetToELB(vpc, https bool) map[string]interface{}
- func RegionToAmazonLinuxAMI() map[string]interface{}
- func UserData(autoScalingLaunchConfigurationLogicalId string) (map[string]interface{}, error)
- type AWSCloudFormationInitCtx
- type PrimaryContainer
- type SecondaryContainer
- type UserDataContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AWSCloudFormationInit ¶
func AWSCloudFormationInit(autoScalingLaunchConfigurationLogicalId string, context AWSCloudFormationInitCtx) (map[string]interface{}, error)
AWSCloudFormationInit produces the value of the AWS::CloudFormation::Init type and should be placed on the Metadata of a AWS::EC2::Instance or AWS::AutoScale::LaunchConfiguration
It works with the UserData field of a AWS::AutoScale::LaunchConfiguration (or AWS::EC2::Instance) to bootstrap an EC2 instance when it's created
Example use:
{
"Resources": {
"AutoScalingLaunchConfiguration": {
"Type": "AWS::AutoScaling::LaunchConfiguration",
"Metadata": {
"AWS::CloudFormation::Init": {{ .Resources.AutoScaling.LaunchConfiguration.Metadata.AWSCloudFormationInit }}
},
"Properties": {
"UserData": {{ .Resources.AutoScaling.LaunchConfiguration.UserData }}
}
}
}
}
func ELBToInstance ¶
Allow EC2 instances to receive traffic from the provisioned ELB
func ImageIdInMap ¶
ImageIdInMap works with a mapping like the following to select an AMI id for the current region
{
"Mappings": {
"RegionToAmazonLinuxAMI": {
"ap-northeast-1": { "Key": "ami-1c1b9f1c" },
"ap-southeast-1": { "Key": "ami-d44b4286" },
"ap-southeast-2": { "Key": "ami-db7b39e1" },
"eu-central-1": { "Key": "ami-a6b0b7bb" },
"eu-west-1": { "Key": "ami-e4d18e93" },
"sa-east-1": { "Key": "ami-55098148" },
"us-east-1": { "Key": "ami-0d4cfd66" },
"us-west-1": { "Key": "ami-87ea13c3" },
"us-west-2": { "Key": "ami-d5c5d1e5" }
}
}
}
func RegionToAmazonLinuxAMI ¶
func RegionToAmazonLinuxAMI() map[string]interface{}
RegionToAmazonLinuxAMI is a mapping of AWS region to the latest released version the Amazon Linux AMI (currently 2015.09.1)
func UserData ¶
UserData is the initial launch script run by an EC2 instance
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AmazonLinuxAMIBasics.html
Types ¶
type AWSCloudFormationInitCtx ¶
type AWSCloudFormationInitCtx struct {
PorterVersion string
Environment string
Region string
EnvFile string
ServiceName string
ServiceVersion string
ServicePayloadBucket string
ServicePayloadKey string
ServicePayloadConfigPath string
PrimaryContainer PrimaryContainer
SecondaryContainers []SecondaryContainer
PorterBinaryUrl string
DevMode bool
EC2BootstrapScript string
Elbs string
}
type PrimaryContainer ¶
type SecondaryContainer ¶
type SecondaryContainer struct {
Name string
}
type UserDataContext ¶
type UserDataContext struct {
LogicalId string
}