Documentation
¶
Index ¶
- Constants
- Variables
- func Handle(request *CustomResourceRequest, customCreds credentials.Value, ...) error
- func Run(request *UserFuncResourceRequest, logger *logrus.Logger) error
- type AbstractCustomResourceRequest
- type CloudFormationLambdaEvent
- type CloudWatchLogsLambdaEventSourceFilter
- type CloudWatchLogsLambdaEventSourceResource
- type CustomResourceCommand
- type CustomResourceFunction
- type CustomResourceRequest
- type GoAWSCustomResource
- type HelloWorldResource
- type S3LambdaEventSourceResource
- type SESLambdaEventSourceResource
- type SESLambdaEventSourceResourceAction
- type SESLambdaEventSourceResourceRule
- type SNSLambdaEventSourceResource
- type UserFuncResourceRequest
- type ZipToS3BucketResource
Constants ¶
const ( // CreateOperation is a request to create a resource // @enum CloudFormationOperation CreateOperation = "Create" // DeleteOperation is a request to delete a resource // @enum CloudFormationOperation DeleteOperation = "Delete" // UpdateOperation is a request to update a resource // @enum CloudFormationOperation UpdateOperation = "Update" )
const DefaultManifestName = "MANIFEST.json"
DefaultManifestName is the name of the file that will be created at the root of the S3 bucket with user-supplied metadata
Variables ¶
var ( // HelloWorld is the typename for HelloWorldResource HelloWorld = cloudFormationResourceType("HelloWorldResource") // S3LambdaEventSource is the typename for S3LambdaEventSourceResource S3LambdaEventSource = cloudFormationResourceType("S3LambdaEventSourceResource") // SNSLambdaEventSource is the typename for SNSLambdaEventSourceResource SNSLambdaEventSource = cloudFormationResourceType("SNSLambdaEventSourceResource") // SESLambdaEventSource is the typename for SESLambdaEventSourceResource SESLambdaEventSource = cloudFormationResourceType("SESLambdaEventSourceResource") // CloudWatchLogsLambdaEventSource is the typename for SESLambdaEventSourceResource CloudWatchLogsLambdaEventSource = cloudFormationResourceType("CloudWatchLogsLambdaEventSourceResource") // ZipToS3Bucket is the typename for ZipToS3Bucket ZipToS3Bucket = cloudFormationResourceType("ZipToS3BucketResource") )
Functions ¶
func Handle ¶
func Handle(request *CustomResourceRequest, customCreds credentials.Value, logger *logrus.Logger) error
Handle processes the given CustomResourceRequest value
Types ¶
type AbstractCustomResourceRequest ¶
type AbstractCustomResourceRequest struct {
RequestType string
ResponseURL string
StackID string `json:"StackId"`
RequestID string `json:"RequestId"`
LogicalResourceID string `json:"LogicalResourceId"`
PhysicalResourceID string `json:"PhysicalResourceId"`
LogGroupName string `json:"logGroupName"`
LogStreamName string `json:"logStreamName"`
ResourceProperties map[string]interface{}
}
AbstractCustomResourceRequest is the base structure used for CustomResourceRequests
type CloudFormationLambdaEvent ¶
type CloudFormationLambdaEvent struct {
RequestType string
ResponseURL string
StackID string `json:"StackId"`
RequestID string `json:"RequestId"`
ResourceType string
LogicalResourceID string `json:"LogicalResourceId"`
PhysicalResourceID string `json:"PhysicalResourceId"`
ResourceProperties map[string]interface{}
OldResourceProperties map[string]interface{}
}
CloudFormationLambdaEvent represents the event data sent during a Lambda invocation in the context of a CloudFormation operation. Ref: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/crpg-ref-requests.html
type CloudWatchLogsLambdaEventSourceFilter ¶
type CloudWatchLogsLambdaEventSourceFilter struct {
Name *gocf.StringExpr
Pattern *gocf.StringExpr
LogGroupName *gocf.StringExpr
}
CloudWatchLogsLambdaEventSourceFilter represents a filter for a cloudwatchlogs stream
type CloudWatchLogsLambdaEventSourceResource ¶
type CloudWatchLogsLambdaEventSourceResource struct {
GoAWSCustomResource
LambdaTargetArn *gocf.StringExpr
Filters []*CloudWatchLogsLambdaEventSourceFilter
RoleARN *gocf.StringExpr `json:",omitempty"`
}
CloudWatchLogsLambdaEventSourceResource is a simple POC showing how to create custom resources
type CustomResourceCommand ¶
type CustomResourceCommand interface {
// contains filtered or unexported methods
}
CustomResourceCommand defines operations that a CustomResource must implement. The return values are either operation outputs or an error value that should be used in the response to the CloudFormation AWS Lambda response.
type CustomResourceFunction ¶
type CustomResourceFunction func(requestType string, stackID string, properties map[string]interface{}, logger *logrus.Logger) (map[string]interface{}, error)
CustomResourceFunction defines a free function that is capable of responding to an incoming Lambda-backed CustomResource request and returning either a map of outputs or an error. It is invoked by Run().
type CustomResourceRequest ¶
type CustomResourceRequest struct {
AbstractCustomResourceRequest
}
CustomResourceRequest is the go representation of a CloudFormation resource request for a resource the catalog that had been previously serialized.
type GoAWSCustomResource ¶
type GoAWSCustomResource struct {
gocf.CloudFormationCustomResource
GoAWSType string
}
GoAWSCustomResource is the common embedded struct for all resources defined by cloudformationresources
type HelloWorldResource ¶
type HelloWorldResource struct {
GoAWSCustomResource
Message string
}
HelloWorldResource is a simple POC showing how to create custom resources
type S3LambdaEventSourceResource ¶
type S3LambdaEventSourceResource struct {
GoAWSCustomResource
BucketArn *gocf.StringExpr
Events []string
LambdaTargetArn *gocf.StringExpr
Filter *s3.NotificationConfigurationFilter `json:"Filter,omitempty"`
}
S3LambdaEventSourceResource manages registering a Lambda function with S3 event
type SESLambdaEventSourceResource ¶
type SESLambdaEventSourceResource struct {
GoAWSCustomResource
RuleSetName *gocf.StringExpr
Rules []*SESLambdaEventSourceResourceRule
}
SESLambdaEventSourceResource handles configuring SES configuration
type SESLambdaEventSourceResourceAction ¶
type SESLambdaEventSourceResourceAction struct {
ActionType *gocf.StringExpr
ActionProperties map[string]interface{}
}
SESLambdaEventSourceResourceAction represents an SES rule action TODO - specialized types for Actions
type SESLambdaEventSourceResourceRule ¶
type SESLambdaEventSourceResourceRule struct {
Name *gocf.StringExpr
Actions []*SESLambdaEventSourceResourceAction
ScanEnabled *gocf.BoolExpr `json:",omitempty"`
Enabled *gocf.BoolExpr `json:",omitempty"`
Recipients []*gocf.StringExpr
TLSPolicy *gocf.StringExpr `json:",omitempty"`
}
SESLambdaEventSourceResourceRule stores settings necessary to configure an SES inbound rule
type SNSLambdaEventSourceResource ¶
type SNSLambdaEventSourceResource struct {
GoAWSCustomResource
LambdaTargetArn *gocf.StringExpr
SNSTopicArn *gocf.StringExpr
}
SNSLambdaEventSourceResource is a simple POC showing how to create custom resources
type UserFuncResourceRequest ¶
type UserFuncResourceRequest struct {
AbstractCustomResourceRequest
LambdaHandler CustomResourceFunction
}
UserFuncResourceRequest is the go representation of the CloudFormation resource request which is handled by a user supplied function. The function result is used as the results for the
type ZipToS3BucketResource ¶
type ZipToS3BucketResource struct {
GoAWSCustomResource
SrcBucket *gocf.StringExpr
SrcKeyName *gocf.StringExpr
DestBucket *gocf.StringExpr
ManifestName string
Manifest map[string]interface{}
}
ZipToS3BucketResource manages populating an S3 bucket with the contents of a ZIP file...