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 ¶
func (v Boolean) MarshalJSON() ([]byte, error)
MarshalJSON serialises the value as JSON data
type Double ¶
type Double float64
Double is an extension of float64 type
func (Double) MarshalJSON ¶
func (v Double) MarshalJSON() ([]byte, error)
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 ¶
func (v Integer) MarshalJSON() ([]byte, error)
MarshalJSON serialises the value as JSON data
type Intrinsic ¶
type Intrinsic struct {
Value MapOfInterfaces
}
Intrinsic represents an intrinsics
func (Intrinsic) MarshalJSON ¶
func (v Intrinsic) MarshalJSON() ([]byte, error)
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 ¶
func (v String) MarshalJSON() ([]byte, error)
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) LoadJSON ¶
func (t *Template) LoadJSON(data []byte) error
LoadJSON will deserialise a JSON template
func (*Template) NewResource ¶
func (t *Template) NewResource(name string, resource Resource) *Value
NewResource adds a resource to the template and returns a CloudFormation reference
func (*Template) RenderJSON ¶
func (t *Template) RenderJSON() ([]byte, error)
RenderJSON will serialise the template to JSON
type Value ¶
type Value struct {
// contains filtered or unexported fields
}
Value represents any JSON value
func MakeFnCIDR ¶
func MakeFnCIDR(arg *Value, n, len int) *Value
MakeFnCIDR constructs an Fn::Cidr intrinsic
func MakeFnGetAtt ¶
func MakeFnGetAtt(arg *Value) *Value
MakeFnGetAtt constructs an Fn::GetAtt intrinsic
func MakeFnGetAttString ¶
func MakeFnGetAttString(arg string) *Value
MakeFnGetAttString constructs an Fn::GetAtt intrinsic for a given string
func MakeFnImportValue ¶
func MakeFnImportValue(arg *Value) *Value
MakeFnImportValue constructs an Fn::ImportValue intrinsic
func MakeFnImportValueString ¶
func MakeFnImportValueString(arg string) *Value
MakeFnImportValueString constructs an Fn::ImportValue intrinsic for a given string
func MakeFnJoin ¶
func MakeFnJoin(sep string, args []*Value) *Value
MakeFnJoin constructs an Fn::Join intrinsic
func MakeFnSelect ¶
func MakeFnSelect(i int, arg *Value) *Value
MakeFnSelect constructs an Fn::Select intrinsic
func MakeFnSplit ¶
func MakeFnSplit(sep string, arg *Value) *Value
MakeFnSplit constructs an Fn::Split intrinsic
func MakeFnSplitString ¶
func MakeFnSplitString(sep string, arg string) *Value
MakeFnSplitString constructs an Fn::Split intrinsic for a given string
func MakeFnSubString ¶
func MakeFnSubString(arg string) *Value
MakeFnSubString constructs an Fn::Sub intrinsic for a given string
func MakeIntrinsic ¶
func MakeIntrinsic(k string, v interface{}) *Value
MakeIntrinsic constructs an intrinsic
func MakeName ¶
func MakeName(suffix string) *Value
MakeName is syntactic sugar for {"Fn::Sub": "${AWS::Stack}-<name>"}
func MakeSlice ¶
func MakeSlice(i ...*Value) []*Value
MakeSlice makes a slice from a list of arguments
func MakeStringSlice ¶
func MakeStringSlice(s ...string) []*Value
MakeStringSlice makes a slice from a list of string arguments
func NewStringSlice ¶
func NewStringSlice(v ...string) *Value
NewStringSlice constructs a representation of slice of strings from the given arguments
func (Value) MarshalJSON ¶
func (v Value) MarshalJSON() ([]byte, error)
MarshalJSON serialises the value as JSON data
func (*Value) UnmarshalJSON ¶
func (v *Value) UnmarshalJSON(b []byte) error
UnmarshalJSON parses JSON data into a value