Documentation ¶
Index ¶
- Constants
- Variables
- type AnyResource
- type AnythingMap
- type AnythingSlice
- type Boolean
- type Double
- type IAMPolicy
- type IAMRole
- type Integer
- type Intrinsic
- type MapOfInterfaces
- func MakeAssumeRolePolicyDocumentForServices(services ...*gfn.Value) MapOfInterfaces
- func MakeAssumeRolePolicyDocumentForServicesWithConditions(condition MapOfInterfaces, services ...*gfn.Value) MapOfInterfaces
- func MakeAssumeRoleWithWebIdentityPolicyDocument(providerARN string, condition MapOfInterfaces) MapOfInterfaces
- func MakePolicyDocument(statements ...MapOfInterfaces) MapOfInterfaces
- type Output
- type OutputExport
- type Resource
- type SliceOfInterfaces
- type String
- type StringSlice
- type Tag
- type Template
- type Value
- func False() *Value
- func MakeFnCIDR(arg *Value, n, len int) *Value
- func MakeFnGetAtt(arg *Value) *Value
- func MakeFnGetAttString(arg string) *Value
- func MakeFnImportValue(arg *Value) *Value
- func MakeFnImportValueString(arg string) *Value
- func MakeFnJoin(sep string, args []*Value) *Value
- func MakeFnSelect(i int, arg *Value) *Value
- func MakeFnSplit(sep string, arg *Value) *Value
- func MakeFnSplitString(sep string, arg string) *Value
- func MakeFnSub(arg *Value) *Value
- func MakeFnSubString(arg string) *Value
- func MakeIntrinsic(k string, v interface{}) *Value
- func MakeName(suffix string) *Value
- func MakeRef(r string) *Value
- func MakeSlice(i ...*Value) []*Value
- func MakeStringSlice(s ...string) []*Value
- func NewBoolean(v bool) *Value
- func NewDouble(v float64) *Value
- func NewInteger(v int) *Value
- func NewString(v string) *Value
- func NewStringSlice(v ...string) *Value
- func NewValue(v json.Marshaler) *Value
- func True() *Value
Constants ¶
const ( AccountID = "AWS::AccountId" NotificationARNs = "AWS::NotificationARNs" NoValue = "AWS::NoValue" Partition = "AWS::Partition" Region = "AWS::Region" StackID = "AWS::StackId" StackName = "AWS::StackName" Ref = "Ref" FnBase64 = "Fn::Base64" FnCIDR = "Fn::Cidr" FnAnd = "Fn::And" FnEquals = "Fn::Equals" FnIf = "Fn::If" FnNot = "Fn::Not" FnOr = "Fn::Or" FnFindInMap = "Fn::FindInMap" FnGetAtt = "Fn::GetAtt" FnGetAZs = "Fn::GetAZs" FnImportValue = "Fn::ImportValue" FnJoin = "Fn::Join" FnSub = "Fn::Sub" FnSelect = "Fn::Select" FnSplit = "Fn::Split" )
Commonly-used constants
const (
AWSTemplateFormatVersion = "2010-09-09"
)
Commonly-used constants
Variables ¶
var ( RefAccountID = MakeRef(AccountID) RefNotificationARNs = MakeRef(NotificationARNs) RefNoValue = MakeRef(NoValue) RefPartition = MakeRef(Partition) RefRegion = MakeRef(Region) RefStackID = MakeRef(StackID) RefStackName = MakeRef(StackName) )
Commonly-used references
Functions ¶
This section is empty.
Types ¶
type AnyResource ¶
type AnyResource struct { Type string Properties interface{} }
AnyResource represents a generic CloudFormation resource
type AnythingMap ¶
type AnythingMap MapOfInterfaces
AnythingMap is an extension of map[string]interface{} type
func (AnythingMap) Convert ¶
func (v AnythingMap) Convert(obj interface{}) error
Convert will serialise the receiver as JSON, and deserialise it into obj
func (AnythingMap) MarshalJSON ¶
func (v AnythingMap) MarshalJSON() ([]byte, error)
MarshalJSON serialises the value as JSON data
type AnythingSlice ¶
type AnythingSlice SliceOfInterfaces
AnythingSlice is an extension of []interface{} type
func (AnythingSlice) Convert ¶
func (v AnythingSlice) Convert(obj interface{}) error
Convert will serialise the receiver as JSON, and deserialise it into obj
func (AnythingSlice) MarshalJSON ¶
func (v AnythingSlice) MarshalJSON() ([]byte, error)
MarshalJSON serialises the value as JSON data
type Boolean ¶
type Boolean bool
Boolean is an extension of bool type
func (Boolean) MarshalJSON ¶
MarshalJSON serialises the value as JSON data
type Double ¶
type Double float64
Double is an extension of float64 type
func (Double) MarshalJSON ¶
MarshalJSON serialises the value as JSON data
type IAMPolicy ¶
type IAMPolicy struct { PolicyName *Value `json:",omitempty"` Roles []*Value `json:",omitempty"` PolicyDocument MapOfInterfaces `json:",omitempty"` }
IAMPolicy represents a CloudFormation AWS::IAM::Policy resource
func (*IAMPolicy) Properties ¶
func (r *IAMPolicy) Properties() interface{}
Properties will return the properties of the resource
type IAMRole ¶
type IAMRole struct { RoleName string `json:",omitempty"` Path string `json:",omitempty"` AssumeRolePolicyDocument MapOfInterfaces `json:",omitempty"` ManagedPolicyArns []interface{} `json:",omitempty"` PermissionsBoundary string `json:",omitempty"` }
IAMRole represents a CloudFormation AWS::IAM::Role resource
func (*IAMRole) Properties ¶
func (r *IAMRole) Properties() interface{}
Properties will return the properties of the resource
type Integer ¶
type Integer int
Integer is an extension of int type
func (Integer) MarshalJSON ¶
MarshalJSON serialises the value as JSON data
type Intrinsic ¶
type Intrinsic struct {
Value MapOfInterfaces
}
Intrinsic represents an intrinsics
func (Intrinsic) MarshalJSON ¶
MarshalJSON serialises the value as JSON data
type MapOfInterfaces ¶
type MapOfInterfaces = map[string]interface{}
MapOfInterfaces is an alias for map[string]interface{}
func MakeAssumeRolePolicyDocumentForServices ¶
func MakeAssumeRolePolicyDocumentForServices(services ...*gfn.Value) MapOfInterfaces
MakeAssumeRolePolicyDocumentForServices constructs a trust policy for given services
func MakeAssumeRolePolicyDocumentForServicesWithConditions ¶ added in v0.134.0
func MakeAssumeRolePolicyDocumentForServicesWithConditions(condition MapOfInterfaces, services ...*gfn.Value) MapOfInterfaces
MakeAssumeRolePolicyDocumentForServices constructs a trust policy for given services with given conditions
func MakeAssumeRoleWithWebIdentityPolicyDocument ¶
func MakeAssumeRoleWithWebIdentityPolicyDocument(providerARN string, condition MapOfInterfaces) MapOfInterfaces
MakeAssumeRoleWithWebIdentityPolicyDocument constructs a trust policy for given a web identity priovider with given conditions
func MakePolicyDocument ¶
func MakePolicyDocument(statements ...MapOfInterfaces) MapOfInterfaces
MakePolicyDocument constructs a policy with given statements
type Output ¶
type Output struct { Value *Value `json:",omitempty"` Export *OutputExport `json:",omitempty"` }
Output represents a CloudFormation output definition
type OutputExport ¶
type OutputExport struct {
Name *Value `json:",omitempty"`
}
OutputExport represents export name of a CloudFormation output
type Resource ¶
type Resource interface { Type() string Properties() interface{} }
Resource defines the interface that every resource should implement
type SliceOfInterfaces ¶
type SliceOfInterfaces = []interface{}
SliceOfInterfaces is an alias for []interface{}
type String ¶
type String string
String is a extension of string type
func (String) MarshalJSON ¶
MarshalJSON serialises the value as JSON data
type StringSlice ¶
type StringSlice []string
StringSlice represents a slice of strings
func (StringSlice) MarshalJSON ¶
func (v StringSlice) MarshalJSON() ([]byte, error)
MarshalJSON serialises the value as JSON data
type Tag ¶
type Tag struct { Key interface{} Value interface{} PropagateAtLaunch string }
Tag is a CloudFormation tag
type Template ¶
type Template struct { AWSTemplateFormatVersion string Description string Resources map[string]AnyResource `json:",omitempty"` Outputs map[string]Output `json:",omitempty"` }
Template is a representation of a CloudFormation template
func NewTemplate ¶
func NewTemplate() *Template
NewTemplate constructs a new Template and returns the reference to it
func (*Template) AttachPolicy ¶
func (t *Template) AttachPolicy(name string, refRole *Value, policyDoc MapOfInterfaces)
AttachPolicy attaches the specified policy document
func (*Template) NewResource ¶
NewResource adds a resource to the template and returns a CloudFormation reference
func (*Template) RenderJSON ¶
RenderJSON will serialise the template to JSON
type Value ¶
type Value struct {
// contains filtered or unexported fields
}
Value represents any JSON value
func MakeFnCIDR ¶
MakeFnCIDR constructs an Fn::Cidr intrinsic
func MakeFnGetAtt ¶
MakeFnGetAtt constructs an Fn::GetAtt intrinsic
func MakeFnGetAttString ¶
MakeFnGetAttString constructs an Fn::GetAtt intrinsic for a given string
func MakeFnImportValue ¶
MakeFnImportValue constructs an Fn::ImportValue intrinsic
func MakeFnImportValueString ¶
MakeFnImportValueString constructs an Fn::ImportValue intrinsic for a given string
func MakeFnJoin ¶
MakeFnJoin constructs an Fn::Join intrinsic
func MakeFnSelect ¶
MakeFnSelect constructs an Fn::Select intrinsic
func MakeFnSplit ¶
MakeFnSplit constructs an Fn::Split intrinsic
func MakeFnSplitString ¶
MakeFnSplitString constructs an Fn::Split intrinsic for a given string
func MakeFnSubString ¶
MakeFnSubString constructs an Fn::Sub intrinsic for a given string
func MakeIntrinsic ¶
MakeIntrinsic constructs an intrinsic
func MakeStringSlice ¶
MakeStringSlice makes a slice from a list of string arguments
func NewStringSlice ¶
NewStringSlice constructs a representation of slice of strings from the given arguments
func (Value) MarshalJSON ¶
MarshalJSON serialises the value as JSON data
func (*Value) UnmarshalJSON ¶
UnmarshalJSON parses JSON data into a value