Documentation ¶
Overview ¶
Package lambda provides a client for AWS Lambda.
Index ¶
- Constants
- type AddPermissionInput
- type AddPermissionOutput
- type AliasConfiguration
- type CreateAliasInput
- type CreateEventSourceMappingInput
- type CreateFunctionInput
- type DeleteAliasInput
- type DeleteAliasOutput
- type DeleteEventSourceMappingInput
- type DeleteFunctionInput
- type DeleteFunctionOutput
- type EventSourceMappingConfiguration
- type FunctionCode
- type FunctionCodeLocation
- type FunctionConfiguration
- type GetAliasInput
- type GetEventSourceMappingInput
- type GetFunctionConfigurationInput
- type GetFunctionInput
- type GetFunctionOutput
- type GetPolicyInput
- type GetPolicyOutput
- type InvokeAsyncInput
- type InvokeAsyncOutput
- type InvokeInput
- type InvokeOutput
- type Lambda
- func (c *Lambda) AddPermission(input *AddPermissionInput) (*AddPermissionOutput, error)
- func (c *Lambda) AddPermissionRequest(input *AddPermissionInput) (req *request.Request, output *AddPermissionOutput)
- func (c *Lambda) CreateAlias(input *CreateAliasInput) (*AliasConfiguration, error)
- func (c *Lambda) CreateAliasRequest(input *CreateAliasInput) (req *request.Request, output *AliasConfiguration)
- func (c *Lambda) CreateEventSourceMapping(input *CreateEventSourceMappingInput) (*EventSourceMappingConfiguration, error)
- func (c *Lambda) CreateEventSourceMappingRequest(input *CreateEventSourceMappingInput) (req *request.Request, output *EventSourceMappingConfiguration)
- func (c *Lambda) CreateFunction(input *CreateFunctionInput) (*FunctionConfiguration, error)
- func (c *Lambda) CreateFunctionRequest(input *CreateFunctionInput) (req *request.Request, output *FunctionConfiguration)
- func (c *Lambda) DeleteAlias(input *DeleteAliasInput) (*DeleteAliasOutput, error)
- func (c *Lambda) DeleteAliasRequest(input *DeleteAliasInput) (req *request.Request, output *DeleteAliasOutput)
- func (c *Lambda) DeleteEventSourceMapping(input *DeleteEventSourceMappingInput) (*EventSourceMappingConfiguration, error)
- func (c *Lambda) DeleteEventSourceMappingRequest(input *DeleteEventSourceMappingInput) (req *request.Request, output *EventSourceMappingConfiguration)
- func (c *Lambda) DeleteFunction(input *DeleteFunctionInput) (*DeleteFunctionOutput, error)
- func (c *Lambda) DeleteFunctionRequest(input *DeleteFunctionInput) (req *request.Request, output *DeleteFunctionOutput)
- func (c *Lambda) GetAlias(input *GetAliasInput) (*AliasConfiguration, error)
- func (c *Lambda) GetAliasRequest(input *GetAliasInput) (req *request.Request, output *AliasConfiguration)
- func (c *Lambda) GetEventSourceMapping(input *GetEventSourceMappingInput) (*EventSourceMappingConfiguration, error)
- func (c *Lambda) GetEventSourceMappingRequest(input *GetEventSourceMappingInput) (req *request.Request, output *EventSourceMappingConfiguration)
- func (c *Lambda) GetFunction(input *GetFunctionInput) (*GetFunctionOutput, error)
- func (c *Lambda) GetFunctionConfiguration(input *GetFunctionConfigurationInput) (*FunctionConfiguration, error)
- func (c *Lambda) GetFunctionConfigurationRequest(input *GetFunctionConfigurationInput) (req *request.Request, output *FunctionConfiguration)
- func (c *Lambda) GetFunctionRequest(input *GetFunctionInput) (req *request.Request, output *GetFunctionOutput)
- func (c *Lambda) GetPolicy(input *GetPolicyInput) (*GetPolicyOutput, error)
- func (c *Lambda) GetPolicyRequest(input *GetPolicyInput) (req *request.Request, output *GetPolicyOutput)
- func (c *Lambda) Invoke(input *InvokeInput) (*InvokeOutput, error)
- func (c *Lambda) InvokeAsync(input *InvokeAsyncInput) (*InvokeAsyncOutput, error)
- func (c *Lambda) InvokeAsyncRequest(input *InvokeAsyncInput) (req *request.Request, output *InvokeAsyncOutput)
- func (c *Lambda) InvokeRequest(input *InvokeInput) (req *request.Request, output *InvokeOutput)
- func (c *Lambda) ListAliases(input *ListAliasesInput) (*ListAliasesOutput, error)
- func (c *Lambda) ListAliasesRequest(input *ListAliasesInput) (req *request.Request, output *ListAliasesOutput)
- func (c *Lambda) ListEventSourceMappings(input *ListEventSourceMappingsInput) (*ListEventSourceMappingsOutput, error)
- func (c *Lambda) ListEventSourceMappingsPages(input *ListEventSourceMappingsInput, ...) error
- func (c *Lambda) ListEventSourceMappingsRequest(input *ListEventSourceMappingsInput) (req *request.Request, output *ListEventSourceMappingsOutput)
- func (c *Lambda) ListFunctions(input *ListFunctionsInput) (*ListFunctionsOutput, error)
- func (c *Lambda) ListFunctionsPages(input *ListFunctionsInput, ...) error
- func (c *Lambda) ListFunctionsRequest(input *ListFunctionsInput) (req *request.Request, output *ListFunctionsOutput)
- func (c *Lambda) ListVersionsByFunction(input *ListVersionsByFunctionInput) (*ListVersionsByFunctionOutput, error)
- func (c *Lambda) ListVersionsByFunctionRequest(input *ListVersionsByFunctionInput) (req *request.Request, output *ListVersionsByFunctionOutput)
- func (c *Lambda) PublishVersion(input *PublishVersionInput) (*FunctionConfiguration, error)
- func (c *Lambda) PublishVersionRequest(input *PublishVersionInput) (req *request.Request, output *FunctionConfiguration)
- func (c *Lambda) RemovePermission(input *RemovePermissionInput) (*RemovePermissionOutput, error)
- func (c *Lambda) RemovePermissionRequest(input *RemovePermissionInput) (req *request.Request, output *RemovePermissionOutput)
- func (c *Lambda) UpdateAlias(input *UpdateAliasInput) (*AliasConfiguration, error)
- func (c *Lambda) UpdateAliasRequest(input *UpdateAliasInput) (req *request.Request, output *AliasConfiguration)
- func (c *Lambda) UpdateEventSourceMapping(input *UpdateEventSourceMappingInput) (*EventSourceMappingConfiguration, error)
- func (c *Lambda) UpdateEventSourceMappingRequest(input *UpdateEventSourceMappingInput) (req *request.Request, output *EventSourceMappingConfiguration)
- func (c *Lambda) UpdateFunctionCode(input *UpdateFunctionCodeInput) (*FunctionConfiguration, error)
- func (c *Lambda) UpdateFunctionCodeRequest(input *UpdateFunctionCodeInput) (req *request.Request, output *FunctionConfiguration)
- func (c *Lambda) UpdateFunctionConfiguration(input *UpdateFunctionConfigurationInput) (*FunctionConfiguration, error)
- func (c *Lambda) UpdateFunctionConfigurationRequest(input *UpdateFunctionConfigurationInput) (req *request.Request, output *FunctionConfiguration)
- type ListAliasesInput
- type ListAliasesOutput
- type ListEventSourceMappingsInput
- type ListEventSourceMappingsOutput
- type ListFunctionsInput
- type ListFunctionsOutput
- type ListVersionsByFunctionInput
- type ListVersionsByFunctionOutput
- type PublishVersionInput
- type RemovePermissionInput
- type RemovePermissionOutput
- type UpdateAliasInput
- type UpdateEventSourceMappingInput
- type UpdateFunctionCodeInput
- type UpdateFunctionConfigurationInput
Examples ¶
- Lambda.AddPermission
- Lambda.CreateAlias
- Lambda.CreateEventSourceMapping
- Lambda.CreateFunction
- Lambda.DeleteAlias
- Lambda.DeleteEventSourceMapping
- Lambda.DeleteFunction
- Lambda.GetAlias
- Lambda.GetEventSourceMapping
- Lambda.GetFunction
- Lambda.GetFunctionConfiguration
- Lambda.GetPolicy
- Lambda.Invoke
- Lambda.InvokeAsync
- Lambda.ListAliases
- Lambda.ListEventSourceMappings
- Lambda.ListFunctions
- Lambda.ListVersionsByFunction
- Lambda.PublishVersion
- Lambda.RemovePermission
- Lambda.UpdateAlias
- Lambda.UpdateEventSourceMapping
- Lambda.UpdateFunctionCode
- Lambda.UpdateFunctionConfiguration
Constants ¶
const ( // @enum EventSourcePosition EventSourcePositionTrimHorizon = "TRIM_HORIZON" // @enum EventSourcePosition EventSourcePositionLatest = "LATEST" )
const ( // @enum InvocationType InvocationTypeEvent = "Event" // @enum InvocationType InvocationTypeRequestResponse = "RequestResponse" // @enum InvocationType InvocationTypeDryRun = "DryRun" )
const ( // @enum LogType LogTypeNone = "None" // @enum LogType LogTypeTail = "Tail" )
const ( // @enum Runtime RuntimeNodejs = "nodejs" // @enum Runtime RuntimeJava8 = "java8" // @enum Runtime RuntimePython27 = "python2.7" )
const ServiceName = "lambda"
A ServiceName is the name of the service the client will make API calls to.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddPermissionInput ¶
type AddPermissionInput struct { // The AWS Lambda action you want to allow in this statement. Each Lambda action // is a string starting with "lambda:" followed by the API name (see Operations). // For example, "lambda:CreateFunction". You can use wildcard ("lambda:*") to // grant permission for all AWS Lambda actions. Action *string `type:"string" required:"true"` // Name of the Lambda function whose resource policy you are updating by adding // a new permission. // // You can specify an unqualified function name (for example, "Thumbnail") // or you can specify Amazon Resource Name (ARN) of the function (for example, // "arn:aws:lambda:us-west-2:account-id:function:ThumbNail"). AWS Lambda also // allows you to specify only the account ID qualifier (for example, "account-id:Thumbnail"). // Note that the length constraint applies only to the ARN. If you specify only // the function name, it is limited to 64 character in length. FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"` // The principal who is getting this permission. It can be Amazon S3 service // Principal ("s3.amazonaws.com") if you want Amazon S3 to invoke the function, // an AWS account ID if you are granting cross-account permission, or any valid // AWS service principal such as "sns.amazonaws.com". For example, you might // want to allow a custom application in another AWS account to push events // to AWS Lambda by invoking your function. Principal *string `type:"string" required:"true"` // You can specify this optional query parameter to specify function version // or alias name. The permission will then apply to the specific qualified ARN. // For example, if you specify function version 2 as the qualifier, then permission // applies only when request is made using qualified function ARN: // // arn:aws:lambda:aws-region:acct-id:function:function-name:2 // // If you specify alias name, for example "PROD", then the permission is valid // only for requests made using the alias ARN: // // arn:aws:lambda:aws-region:acct-id:function:function-name:PROD // // If the qualifier is not specified, the permission is valid only when requests // is made using unqualified function ARN. // // arn:aws:lambda:aws-region:acct-id:function:function-name Qualifier *string `location:"querystring" locationName:"Qualifier" min:"1" type:"string"` // The AWS account ID (without a hyphen) of the source owner. For example, if // the SourceArn identifies a bucket, then this is the bucket owner's account // ID. You can use this additional condition to ensure the bucket you specify // is owned by a specific account (it is possible the bucket owner deleted the // bucket and some other AWS account created the bucket). You can also use this // condition to specify all sources (that is, you don't specify the SourceArn) // owned by a specific account. SourceAccount *string `type:"string"` // This is optional; however, when granting Amazon S3 permission to invoke your // function, you should specify this field with the bucket Amazon Resource Name // (ARN) as its value. This ensures that only events generated from the specified // bucket can invoke the function. // // If you add a permission for the Amazon S3 principal without providing the // source ARN, any AWS account that creates a mapping to your function ARN can // send events to invoke your Lambda function from Amazon S3. SourceArn *string `type:"string"` // A unique statement identifier. StatementId *string `min:"1" type:"string" required:"true"` // contains filtered or unexported fields }
func (AddPermissionInput) GoString ¶ added in v0.6.5
func (s AddPermissionInput) GoString() string
GoString returns the string representation
func (AddPermissionInput) String ¶ added in v0.6.5
func (s AddPermissionInput) String() string
String returns the string representation
type AddPermissionOutput ¶
type AddPermissionOutput struct { // The permission statement you specified in the request. The response returns // the same as a string using "\" as an escape character in the JSON. Statement *string `type:"string"` // contains filtered or unexported fields }
func (AddPermissionOutput) GoString ¶ added in v0.6.5
func (s AddPermissionOutput) GoString() string
GoString returns the string representation
func (AddPermissionOutput) String ¶ added in v0.6.5
func (s AddPermissionOutput) String() string
String returns the string representation
type AliasConfiguration ¶ added in v0.9.14
type AliasConfiguration struct { // Lambda function ARN that is qualified using alias name as the suffix. For // example, if you create an alias "BETA" pointing to a helloworld function // version, the ARN is arn:aws:lambda:aws-regions:acct-id:function:helloworld:BETA. AliasArn *string `type:"string"` // Alias description. Description *string `type:"string"` // Function version to which the alias points. FunctionVersion *string `min:"1" type:"string"` // Alias name. Name *string `min:"1" type:"string"` // contains filtered or unexported fields }
Provides configuration information about a Lambda function version alias.
func (AliasConfiguration) GoString ¶ added in v0.9.14
func (s AliasConfiguration) GoString() string
GoString returns the string representation
func (AliasConfiguration) String ¶ added in v0.9.14
func (s AliasConfiguration) String() string
String returns the string representation
type CreateAliasInput ¶ added in v0.9.14
type CreateAliasInput struct { // Description of the alias. Description *string `type:"string"` // Name of the Lambda function for which you want to create an alias. FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"` // Lambda function version for which you are creating the alias. FunctionVersion *string `min:"1" type:"string" required:"true"` // Name for the alias your creating. Name *string `min:"1" type:"string" required:"true"` // contains filtered or unexported fields }
func (CreateAliasInput) GoString ¶ added in v0.9.14
func (s CreateAliasInput) GoString() string
GoString returns the string representation
func (CreateAliasInput) String ¶ added in v0.9.14
func (s CreateAliasInput) String() string
String returns the string representation
type CreateEventSourceMappingInput ¶
type CreateEventSourceMappingInput struct { // The largest number of records that AWS Lambda will retrieve from your event // source at the time of invoking your function. Your function receives an event // with all the retrieved records. The default is 100 records. BatchSize *int64 `min:"1" type:"integer"` // Indicates whether AWS Lambda should begin polling the event source. By default, // Enabled is true. Enabled *bool `type:"boolean"` // The Amazon Resource Name (ARN) of the Amazon Kinesis or the Amazon DynamoDB // stream that is the event source. Any record added to this stream could cause // AWS Lambda to invoke your Lambda function, it depends on the BatchSize. AWS // Lambda POSTs the Amazon Kinesis event, containing records, to your Lambda // function as JSON. EventSourceArn *string `type:"string" required:"true"` // The Lambda function to invoke when AWS Lambda detects an event on the stream. // // You can specify an unqualified function name (for example, "Thumbnail") // or you can specify Amazon Resource Name (ARN) of the function (for example, // "arn:aws:lambda:us-west-2:account-id:function:ThumbNail"). AWS Lambda also // allows you to specify only the account ID qualifier (for example, "account-id:Thumbnail"). // Note that the length constraint applies only to the ARN. If you specify only // the function name, it is limited to 64 character in length. FunctionName *string `min:"1" type:"string" required:"true"` // The position in the stream where AWS Lambda should start reading. For more // information, go to ShardIteratorType (http://docs.aws.amazon.com/kinesis/latest/APIReference/API_GetShardIterator.html#Kinesis-GetShardIterator-request-ShardIteratorType) // in the Amazon Kinesis API Reference. StartingPosition *string `type:"string" required:"true" enum:"EventSourcePosition"` // contains filtered or unexported fields }
func (CreateEventSourceMappingInput) GoString ¶ added in v0.6.5
func (s CreateEventSourceMappingInput) GoString() string
GoString returns the string representation
func (CreateEventSourceMappingInput) String ¶ added in v0.6.5
func (s CreateEventSourceMappingInput) String() string
String returns the string representation
type CreateFunctionInput ¶
type CreateFunctionInput struct { // The code for the Lambda function. Code *FunctionCode `type:"structure" required:"true"` // A short, user-defined function description. Lambda does not use this value. // Assign a meaningful description as you see fit. Description *string `type:"string"` // The name you want to assign to the function you are uploading. You can specify // an unqualified function name (for example, "Thumbnail") or you can specify // Amazon Resource Name (ARN) of the function (for example, "arn:aws:lambda:us-west-2:account-id:function:ThumbNail"). // AWS Lambda also allows you to specify only the account ID qualifier (for // example, "account-id:Thumbnail"). Note that the length constraint applies // only to the ARN. If you specify only the function name, it is limited to // 64 character in length. The function names appear in the console and are // returned in the ListFunctions API. Function names are used to specify functions // to other AWS Lambda APIs, such as Invoke. FunctionName *string `min:"1" type:"string" required:"true"` // The function within your code that Lambda calls to begin execution. For Node.js, // it is the module-name.export value in your function. For Java, it can be // package.class-name::handler or package.class-name. For more information, // see Lambda Function Handler (Java) (http://docs.aws.amazon.com/lambda/latest/dg/java-programming-model-handler-types.html). Handler *string `type:"string" required:"true"` // The amount of memory, in MB, your Lambda function is given. Lambda uses this // memory size to infer the amount of CPU and memory allocated to your function. // Your function use-case determines your CPU and memory requirements. For example, // a database operation might need less memory compared to an image processing // function. The default value is 128 MB. The value must be a multiple of 64 // MB. MemorySize *int64 `min:"128" type:"integer"` // This boolean parameter can be used to request AWS Lambda to create the Lambda // function and publish a version as an atomic operation. Publish *bool `type:"boolean"` // The Amazon Resource Name (ARN) of the IAM role that Lambda assumes when it // executes your function to access any other Amazon Web Services (AWS) resources. // For more information, see AWS Lambda: How it Works (http://docs.aws.amazon.com/lambda/latest/dg/lambda-introduction.html) Role *string `type:"string" required:"true"` // The runtime environment for the Lambda function you are uploading. Currently, // Lambda supports "java" and "nodejs" as the runtime. Runtime *string `type:"string" required:"true" enum:"Runtime"` // The function execution time at which Lambda should terminate the function. // Because the execution time has cost implications, we recommend you set this // value based on your expected execution time. The default is 3 seconds. Timeout *int64 `min:"1" type:"integer"` // contains filtered or unexported fields }
func (CreateFunctionInput) GoString ¶ added in v0.6.5
func (s CreateFunctionInput) GoString() string
GoString returns the string representation
func (CreateFunctionInput) String ¶ added in v0.6.5
func (s CreateFunctionInput) String() string
String returns the string representation
type DeleteAliasInput ¶ added in v0.9.14
type DeleteAliasInput struct { // The Lambda function name for which the alias is created. FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"` // Name of the alias to delete. Name *string `location:"uri" locationName:"Name" min:"1" type:"string" required:"true"` // contains filtered or unexported fields }
func (DeleteAliasInput) GoString ¶ added in v0.9.14
func (s DeleteAliasInput) GoString() string
GoString returns the string representation
func (DeleteAliasInput) String ¶ added in v0.9.14
func (s DeleteAliasInput) String() string
String returns the string representation
type DeleteAliasOutput ¶ added in v0.9.14
type DeleteAliasOutput struct {
// contains filtered or unexported fields
}
func (DeleteAliasOutput) GoString ¶ added in v0.9.14
func (s DeleteAliasOutput) GoString() string
GoString returns the string representation
func (DeleteAliasOutput) String ¶ added in v0.9.14
func (s DeleteAliasOutput) String() string
String returns the string representation
type DeleteEventSourceMappingInput ¶
type DeleteEventSourceMappingInput struct { // The event source mapping ID. UUID *string `location:"uri" locationName:"UUID" type:"string" required:"true"` // contains filtered or unexported fields }
func (DeleteEventSourceMappingInput) GoString ¶ added in v0.6.5
func (s DeleteEventSourceMappingInput) GoString() string
GoString returns the string representation
func (DeleteEventSourceMappingInput) String ¶ added in v0.6.5
func (s DeleteEventSourceMappingInput) String() string
String returns the string representation
type DeleteFunctionInput ¶
type DeleteFunctionInput struct { // The Lambda function to delete. // // You can specify an unqualified function name (for example, "Thumbnail") // or you can specify Amazon Resource Name (ARN) of the function (for example, // "arn:aws:lambda:us-west-2:account-id:function:ThumbNail"). AWS Lambda also // allows you to specify only the account ID qualifier (for example, "account-id:Thumbnail"). // Note that the length constraint applies only to the ARN. If you specify only // the function name, it is limited to 64 character in length. FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"` // Using this optional parameter you can specify a function version (but not // the $LATEST version) to direct AWS Lambda to delete a specific function version. // If the function version has one or more aliases pointing to it, you will // get an error because you cannot have aliases pointing to it. You can delete // any function version but not the $LATEST, that is, you cannot specify $LATEST // as the value of this parameter. The $LATEST version can be deleted only when // you want to delete all the function versions and aliases. // // You can only specify a function version and not alias name using this parameter. // You cannot delete a function version using its alias. // // If you don't specify this parameter, AWS Lambda will delete the function, // including all its versions and aliases. Qualifier *string `location:"querystring" locationName:"Qualifier" min:"1" type:"string"` // contains filtered or unexported fields }
func (DeleteFunctionInput) GoString ¶ added in v0.6.5
func (s DeleteFunctionInput) GoString() string
GoString returns the string representation
func (DeleteFunctionInput) String ¶ added in v0.6.5
func (s DeleteFunctionInput) String() string
String returns the string representation
type DeleteFunctionOutput ¶
type DeleteFunctionOutput struct {
// contains filtered or unexported fields
}
func (DeleteFunctionOutput) GoString ¶ added in v0.6.5
func (s DeleteFunctionOutput) GoString() string
GoString returns the string representation
func (DeleteFunctionOutput) String ¶ added in v0.6.5
func (s DeleteFunctionOutput) String() string
String returns the string representation
type EventSourceMappingConfiguration ¶
type EventSourceMappingConfiguration struct { // The largest number of records that AWS Lambda will retrieve from your event // source at the time of invoking your function. Your function receives an event // with all the retrieved records. BatchSize *int64 `min:"1" type:"integer"` // The Amazon Resource Name (ARN) of the Amazon Kinesis stream that is the source // of events. EventSourceArn *string `type:"string"` // The Lambda function to invoke when AWS Lambda detects an event on the stream. FunctionArn *string `type:"string"` // The UTC time string indicating the last time the event mapping was updated. LastModified *time.Time `type:"timestamp" timestampFormat:"unix"` // The result of the last AWS Lambda invocation of your Lambda function. LastProcessingResult *string `type:"string"` // The state of the event source mapping. It can be "Creating", "Enabled", "Disabled", // "Enabling", "Disabling", "Updating", or "Deleting". State *string `type:"string"` // The reason the event source mapping is in its current state. It is either // user-requested or an AWS Lambda-initiated state transition. StateTransitionReason *string `type:"string"` // The AWS Lambda assigned opaque identifier for the mapping. UUID *string `type:"string"` // contains filtered or unexported fields }
Describes mapping between an Amazon Kinesis stream and a Lambda function.
func (EventSourceMappingConfiguration) GoString ¶ added in v0.6.5
func (s EventSourceMappingConfiguration) GoString() string
GoString returns the string representation
func (EventSourceMappingConfiguration) String ¶ added in v0.6.5
func (s EventSourceMappingConfiguration) String() string
String returns the string representation
type FunctionCode ¶
type FunctionCode struct { // Amazon S3 bucket name where the .zip file containing your deployment package // is stored. This bucket must reside in the same AWS region where you are creating // the Lambda function. S3Bucket *string `min:"3" type:"string"` // The Amazon S3 object (the deployment package) key name you want to upload. S3Key *string `min:"1" type:"string"` // The Amazon S3 object (the deployment package) version you want to upload. S3ObjectVersion *string `min:"1" type:"string"` // A base64-encoded .zip file containing your deployment package. For more information // about creating a .zip file, go to Execution Permissions (http://docs.aws.amazon.com/lambda/latest/dg/intro-permission-model.html#lambda-intro-execution-role.html) // in the AWS Lambda Developer Guide. ZipFile []byte `type:"blob"` // contains filtered or unexported fields }
The code for the Lambda function.
func (FunctionCode) GoString ¶ added in v0.6.5
func (s FunctionCode) GoString() string
GoString returns the string representation
func (FunctionCode) String ¶ added in v0.6.5
func (s FunctionCode) String() string
String returns the string representation
type FunctionCodeLocation ¶
type FunctionCodeLocation struct { // The presigned URL you can use to download the function's .zip file that you // previously uploaded. The URL is valid for up to 10 minutes. Location *string `type:"string"` // The repository from which you can download the function. RepositoryType *string `type:"string"` // contains filtered or unexported fields }
The object for the Lambda function location.
func (FunctionCodeLocation) GoString ¶ added in v0.6.5
func (s FunctionCodeLocation) GoString() string
GoString returns the string representation
func (FunctionCodeLocation) String ¶ added in v0.6.5
func (s FunctionCodeLocation) String() string
String returns the string representation
type FunctionConfiguration ¶
type FunctionConfiguration struct { // It is the SHA256 hash of your function deployment package. CodeSha256 *string `type:"string"` // The size, in bytes, of the function .zip file you uploaded. CodeSize *int64 `type:"long"` // The user-provided description. Description *string `type:"string"` // The Amazon Resource Name (ARN) assigned to the function. FunctionArn *string `type:"string"` // The name of the function. FunctionName *string `min:"1" type:"string"` // The function Lambda calls to begin executing your function. Handler *string `type:"string"` // The timestamp of the last time you updated the function. LastModified *string `type:"string"` // The memory size, in MB, you configured for the function. Must be a multiple // of 64 MB. MemorySize *int64 `min:"128" type:"integer"` // The Amazon Resource Name (ARN) of the IAM role that Lambda assumes when it // executes your function to access any other Amazon Web Services (AWS) resources. Role *string `type:"string"` // The runtime environment for the Lambda function. Runtime *string `type:"string" enum:"Runtime"` // The function execution time at which Lambda should terminate the function. // Because the execution time has cost implications, we recommend you set this // value based on your expected execution time. The default is 3 seconds. Timeout *int64 `min:"1" type:"integer"` // The version of the Lambda function. Version *string `min:"1" type:"string"` // contains filtered or unexported fields }
A complex type that describes function metadata.
func (FunctionConfiguration) GoString ¶ added in v0.6.5
func (s FunctionConfiguration) GoString() string
GoString returns the string representation
func (FunctionConfiguration) String ¶ added in v0.6.5
func (s FunctionConfiguration) String() string
String returns the string representation
type GetAliasInput ¶ added in v0.9.14
type GetAliasInput struct { // Function name for which the alias is created. An alias is a subresource that // exists only in the context of an existing Lambda function. So you must specify // the function name. FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"` // Name of the alias for which you want to retrieve information. Name *string `location:"uri" locationName:"Name" min:"1" type:"string" required:"true"` // contains filtered or unexported fields }
func (GetAliasInput) GoString ¶ added in v0.9.14
func (s GetAliasInput) GoString() string
GoString returns the string representation
func (GetAliasInput) String ¶ added in v0.9.14
func (s GetAliasInput) String() string
String returns the string representation
type GetEventSourceMappingInput ¶
type GetEventSourceMappingInput struct { // The AWS Lambda assigned ID of the event source mapping. UUID *string `location:"uri" locationName:"UUID" type:"string" required:"true"` // contains filtered or unexported fields }
func (GetEventSourceMappingInput) GoString ¶ added in v0.6.5
func (s GetEventSourceMappingInput) GoString() string
GoString returns the string representation
func (GetEventSourceMappingInput) String ¶ added in v0.6.5
func (s GetEventSourceMappingInput) String() string
String returns the string representation
type GetFunctionConfigurationInput ¶
type GetFunctionConfigurationInput struct { // The name of the Lambda function for which you want to retrieve the configuration // information. // // You can specify an unqualified function name (for example, "Thumbnail") // or you can specify Amazon Resource Name (ARN) of the function (for example, // "arn:aws:lambda:us-west-2:account-id:function:ThumbNail"). AWS Lambda also // allows you to specify only the account ID qualifier (for example, "account-id:Thumbnail"). // Note that the length constraint applies only to the ARN. If you specify only // the function name, it is limited to 64 character in length. FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"` // Using this optional parameter you can specify function version or alias name. // If you specify function version, the API uses qualified function ARN and // returns information about the specific function version. if you specify alias // name, the API uses alias ARN and returns information about the function version // to which the alias points. // // If you don't specify this parameter, the API uses unqualified function ARN, // and returns information about the $LATEST function version. Qualifier *string `location:"querystring" locationName:"Qualifier" min:"1" type:"string"` // contains filtered or unexported fields }
func (GetFunctionConfigurationInput) GoString ¶ added in v0.6.5
func (s GetFunctionConfigurationInput) GoString() string
GoString returns the string representation
func (GetFunctionConfigurationInput) String ¶ added in v0.6.5
func (s GetFunctionConfigurationInput) String() string
String returns the string representation
type GetFunctionInput ¶
type GetFunctionInput struct { // The Lambda function name. // // You can specify an unqualified function name (for example, "Thumbnail") // or you can specify Amazon Resource Name (ARN) of the function (for example, // "arn:aws:lambda:us-west-2:account-id:function:ThumbNail"). AWS Lambda also // allows you to specify only the account ID qualifier (for example, "account-id:Thumbnail"). // Note that the length constraint applies only to the ARN. If you specify only // the function name, it is limited to 64 character in length. FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"` // Using this optional parameter to specify a function version or alias name. // If you specify function version, the API uses qualified function ARN for // the request and returns information about the specific Lambda function version. // If you specify alias name, the API uses alias ARN and returns information // about the function version to which the alias points. If you don't provide // this parameter, the API uses unqualified function ARN and returns information // about the $LATEST version of the Lambda function. Qualifier *string `location:"querystring" locationName:"Qualifier" min:"1" type:"string"` // contains filtered or unexported fields }
func (GetFunctionInput) GoString ¶ added in v0.6.5
func (s GetFunctionInput) GoString() string
GoString returns the string representation
func (GetFunctionInput) String ¶ added in v0.6.5
func (s GetFunctionInput) String() string
String returns the string representation
type GetFunctionOutput ¶
type GetFunctionOutput struct { // The object for the Lambda function location. Code *FunctionCodeLocation `type:"structure"` // A complex type that describes function metadata. Configuration *FunctionConfiguration `type:"structure"` // contains filtered or unexported fields }
This response contains the object for the Lambda function location (see API_FunctionCodeLocation
func (GetFunctionOutput) GoString ¶ added in v0.6.5
func (s GetFunctionOutput) GoString() string
GoString returns the string representation
func (GetFunctionOutput) String ¶ added in v0.6.5
func (s GetFunctionOutput) String() string
String returns the string representation
type GetPolicyInput ¶
type GetPolicyInput struct { // Function name whose resource policy you want to retrieve. // // You can specify an unqualified function name (for example, "Thumbnail") // or you can specify Amazon Resource Name (ARN) of the function (for example, // "arn:aws:lambda:us-west-2:account-id:function:ThumbNail"). AWS Lambda also // allows you to specify only the account ID qualifier (for example, "account-id:Thumbnail"). // Note that the length constraint applies only to the ARN. If you specify only // the function name, it is limited to 64 character in length. FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"` // You can specify this optional query parameter to specify function version // or alias name in which case this API will return all permissions associated // with the specific ARN. If you don't provide this parameter, the API will // return permissions that apply to the unqualified function ARN. Qualifier *string `min:"1" type:"string"` // contains filtered or unexported fields }
func (GetPolicyInput) GoString ¶ added in v0.6.5
func (s GetPolicyInput) GoString() string
GoString returns the string representation
func (GetPolicyInput) String ¶ added in v0.6.5
func (s GetPolicyInput) String() string
String returns the string representation
type GetPolicyOutput ¶
type GetPolicyOutput struct { // The resource policy associated with the specified function. The response // returns the same as a string using "\" as an escape character in the JSON. Policy *string `type:"string"` // contains filtered or unexported fields }
func (GetPolicyOutput) GoString ¶ added in v0.6.5
func (s GetPolicyOutput) GoString() string
GoString returns the string representation
func (GetPolicyOutput) String ¶ added in v0.6.5
func (s GetPolicyOutput) String() string
String returns the string representation
type InvokeAsyncInput ¶
type InvokeAsyncInput struct { // The Lambda function name. FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"` // JSON that you want to provide to your Lambda function as input. InvokeArgs io.ReadSeeker `type:"blob" required:"true"` // contains filtered or unexported fields }
func (InvokeAsyncInput) GoString ¶ added in v0.6.5
func (s InvokeAsyncInput) GoString() string
GoString returns the string representation
func (InvokeAsyncInput) String ¶ added in v0.6.5
func (s InvokeAsyncInput) String() string
String returns the string representation
type InvokeAsyncOutput ¶
type InvokeAsyncOutput struct { // It will be 202 upon success. Status *int64 `location:"statusCode" type:"integer"` // contains filtered or unexported fields }
Upon success, it returns empty response. Otherwise, throws an exception.
func (InvokeAsyncOutput) GoString ¶ added in v0.6.5
func (s InvokeAsyncOutput) GoString() string
GoString returns the string representation
func (InvokeAsyncOutput) String ¶ added in v0.6.5
func (s InvokeAsyncOutput) String() string
String returns the string representation
type InvokeInput ¶
type InvokeInput struct { // Using the ClientContext you can pass client-specific information to the Lambda // function you are invoking. You can then process the client information in // your Lambda function as you choose through the context variable. For an example // of a ClientContext JSON, go to PutEvents (http://docs.aws.amazon.com/mobileanalytics/latest/ug/PutEvents.html) // in the Amazon Mobile Analytics API Reference and User Guide. // // The ClientContext JSON must be base64-encoded. ClientContext *string `location:"header" locationName:"X-Amz-Client-Context" type:"string"` // The Lambda function name. // // You can specify an unqualified function name (for example, "Thumbnail") // or you can specify Amazon Resource Name (ARN) of the function (for example, // "arn:aws:lambda:us-west-2:account-id:function:ThumbNail"). AWS Lambda also // allows you to specify only the account ID qualifier (for example, "account-id:Thumbnail"). // Note that the length constraint applies only to the ARN. If you specify only // the function name, it is limited to 64 character in length. FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"` // By default, the Invoke API assumes "RequestResponse" invocation type. You // can optionally request asynchronous execution by specifying "Event" as the // InvocationType. You can also use this parameter to request AWS Lambda to // not execute the function but do some verification, such as if the caller // is authorized to invoke the function and if the inputs are valid. You request // this by specifying "DryRun" as the InvocationType. This is useful in a cross-account // scenario when you want to verify access to a function without running it. InvocationType *string `location:"header" locationName:"X-Amz-Invocation-Type" type:"string" enum:"InvocationType"` // You can set this optional parameter to "Tail" in the request only if you // specify the InvocationType parameter with value "RequestResponse". In this // case, AWS Lambda returns the base64-encoded last 4 KB of log data produced // by your Lambda function in the x-amz-log-results header. LogType *string `location:"header" locationName:"X-Amz-Log-Type" type:"string" enum:"LogType"` // JSON that you want to provide to your Lambda function as input. Payload []byte `type:"blob"` // You can use this optional paramter to specify a Lambda function version or // alias name. If you specify function version, the API uses qualified function // ARN to invoke a specific Lambda function. If you specify alias name, the // API uses the alias ARN to invoke the Lambda function version to which the // alias points. // // If you don't provide this parameter, then the API uses unqualified function // ARN which results in invocation of the $LATEST version. Qualifier *string `location:"querystring" locationName:"Qualifier" min:"1" type:"string"` // contains filtered or unexported fields }
func (InvokeInput) GoString ¶ added in v0.6.5
func (s InvokeInput) GoString() string
GoString returns the string representation
func (InvokeInput) String ¶ added in v0.6.5
func (s InvokeInput) String() string
String returns the string representation
type InvokeOutput ¶
type InvokeOutput struct { // Indicates whether an error occurred while executing the Lambda function. // If an error occurred this field will have one of two values; Handled or Unhandled. // Handled errors are errors that are reported by the function while the Unhandled // errors are those detected and reported by AWS Lambda. Unhandled errors include // out of memory errors and function timeouts. For information about how to // report an Handled error, see Programming Model (http://docs.aws.amazon.com/lambda/latest/dg/programming-model.html). FunctionError *string `location:"header" locationName:"X-Amz-Function-Error" type:"string"` // It is the base64-encoded logs for the Lambda function invocation. This is // present only if the invocation type is "RequestResponse" and the logs were // requested. LogResult *string `location:"header" locationName:"X-Amz-Log-Result" type:"string"` // It is the JSON representation of the object returned by the Lambda function. // In This is present only if the invocation type is "RequestResponse". // // In the event of a function error this field contains a message describing // the error. For the Handled errors the Lambda function will report this message. // For Unhandled errors AWS Lambda reports the message. Payload []byte `type:"blob"` // The HTTP status code will be in the 200 range for successful request. For // the "RequestResonse" invocation type this status code will be 200. For the // "Event" invocation type this status code will be 202. For the "DryRun" invocation // type the status code will be 204. StatusCode *int64 `location:"statusCode" type:"integer"` // contains filtered or unexported fields }
Upon success, returns an empty response. Otherwise, throws an exception.
func (InvokeOutput) GoString ¶ added in v0.6.5
func (s InvokeOutput) GoString() string
GoString returns the string representation
func (InvokeOutput) String ¶ added in v0.6.5
func (s InvokeOutput) String() string
String returns the string representation
type Lambda ¶
Overview
This is the AWS Lambda API Reference. The AWS Lambda Developer Guide provides additional information. For the service overview, go to What is AWS Lambda (http://docs.aws.amazon.com/lambda/latest/dg/welcome.html), and for information about how the service works, go to AWS Lambda: How it Works (http://docs.aws.amazon.com/lambda/latest/dg/lambda-introduction.html) in the AWS Lambda Developer Guide. The service client's operations are safe to be used concurrently. It is not safe to mutate any of the client's properties though.
func New ¶
func New(p client.ConfigProvider, cfgs ...*aws.Config) *Lambda
New creates a new instance of the Lambda client with a session. If additional configuration is needed for the client instance use the optional aws.Config parameter to add your extra config.
Example:
// Create a Lambda client from just a session. svc := lambda.New(mySession) // Create a Lambda client with additional configuration svc := lambda.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
func (*Lambda) AddPermission ¶
func (c *Lambda) AddPermission(input *AddPermissionInput) (*AddPermissionOutput, error)
Adds a permission to the resource policy associated with the specified AWS Lambda function. You use resource policies to grant permissions to event sources that use "push" model. In "push" model, event sources (such as Amazon S3 and custom applications) invoke your Lambda function. Each permission you add to the resource policy allows an event source, permission to invoke the Lambda function.
For information about the push model, see AWS Lambda: How it Works (http://docs.aws.amazon.com/lambda/latest/dg/lambda-introduction.html).
If you are using versioning feature (see AWS Lambda Function Versioning and Aliases (http://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases-v2.html)), a Lambda function can have multiple ARNs that can be used to invoke the function. Note that, each permission you add to resource policy using this API is specific to an ARN, specified using the Qualifier parameter
This operation requires permission for the lambda:AddPermission action.
Example ¶
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/lambda" ) func main() { svc := lambda.New(session.New()) params := &lambda.AddPermissionInput{ Action: aws.String("Action"), // Required FunctionName: aws.String("FunctionName"), // Required Principal: aws.String("Principal"), // Required StatementId: aws.String("StatementId"), // Required Qualifier: aws.String("Qualifier"), SourceAccount: aws.String("SourceOwner"), SourceArn: aws.String("Arn"), } resp, err := svc.AddPermission(params) if err != nil { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) return } // Pretty-print the response data. fmt.Println(resp) }
Output:
func (*Lambda) AddPermissionRequest ¶
func (c *Lambda) AddPermissionRequest(input *AddPermissionInput) (req *request.Request, output *AddPermissionOutput)
AddPermissionRequest generates a request for the AddPermission operation.
func (*Lambda) CreateAlias ¶ added in v0.9.14
func (c *Lambda) CreateAlias(input *CreateAliasInput) (*AliasConfiguration, error)
Creates an alias to the specified Lambda function version. For more information, see Introduction to AWS Lambda Aliases (http://docs.aws.amazon.com/lambda/latest/dg/versioning-v2-intro-aliases.html)
This requires permission for the lambda:CreateAlias action.
Example ¶
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/lambda" ) func main() { svc := lambda.New(session.New()) params := &lambda.CreateAliasInput{ FunctionName: aws.String("FunctionName"), // Required FunctionVersion: aws.String("Version"), // Required Name: aws.String("Alias"), // Required Description: aws.String("Description"), } resp, err := svc.CreateAlias(params) if err != nil { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) return } // Pretty-print the response data. fmt.Println(resp) }
Output:
func (*Lambda) CreateAliasRequest ¶ added in v0.9.14
func (c *Lambda) CreateAliasRequest(input *CreateAliasInput) (req *request.Request, output *AliasConfiguration)
CreateAliasRequest generates a request for the CreateAlias operation.
func (*Lambda) CreateEventSourceMapping ¶
func (c *Lambda) CreateEventSourceMapping(input *CreateEventSourceMappingInput) (*EventSourceMappingConfiguration, error)
Identifies a stream as an event source for a Lambda function. It can be either an Amazon Kinesis stream or an Amazon DynamoDB stream. AWS Lambda invokes the specified function when records are posted to the stream.
This is the pull model, where AWS Lambda invokes the function. For more information, go to AWS Lambda: How it Works (http://docs.aws.amazon.com/lambda/latest/dg/lambda-introduction.html) in the AWS Lambda Developer Guide.
This association between an Amazon Kinesis stream and a Lambda function is called the event source mapping. You provide the configuration information (for example, which stream to read from and which Lambda function to invoke) for the event source mapping in the request body.
Each event source, such as an Amazon Kinesis or a DynamoDB stream, can
be associated with multiple AWS Lambda function. A given Lambda function can be associated with multiple AWS event sources.
This operation requires permission for the lambda:CreateEventSourceMapping action.
Example ¶
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/lambda" ) func main() { svc := lambda.New(session.New()) params := &lambda.CreateEventSourceMappingInput{ EventSourceArn: aws.String("Arn"), // Required FunctionName: aws.String("FunctionName"), // Required StartingPosition: aws.String("EventSourcePosition"), // Required BatchSize: aws.Int64(1), Enabled: aws.Bool(true), } resp, err := svc.CreateEventSourceMapping(params) if err != nil { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) return } // Pretty-print the response data. fmt.Println(resp) }
Output:
func (*Lambda) CreateEventSourceMappingRequest ¶
func (c *Lambda) CreateEventSourceMappingRequest(input *CreateEventSourceMappingInput) (req *request.Request, output *EventSourceMappingConfiguration)
CreateEventSourceMappingRequest generates a request for the CreateEventSourceMapping operation.
func (*Lambda) CreateFunction ¶
func (c *Lambda) CreateFunction(input *CreateFunctionInput) (*FunctionConfiguration, error)
Creates a new Lambda function. The function metadata is created from the request parameters, and the code for the function is provided by a .zip file in the request body. If the function name already exists, the operation will fail. Note that the function name is case-sensitive.
This operation requires permission for the lambda:CreateFunction action.
Example ¶
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/lambda" ) func main() { svc := lambda.New(session.New()) params := &lambda.CreateFunctionInput{ Code: &lambda.FunctionCode{ // Required S3Bucket: aws.String("S3Bucket"), S3Key: aws.String("S3Key"), S3ObjectVersion: aws.String("S3ObjectVersion"), ZipFile: []byte("PAYLOAD"), }, FunctionName: aws.String("FunctionName"), // Required Handler: aws.String("Handler"), // Required Role: aws.String("RoleArn"), // Required Runtime: aws.String("Runtime"), // Required Description: aws.String("Description"), MemorySize: aws.Int64(1), Publish: aws.Bool(true), Timeout: aws.Int64(1), } resp, err := svc.CreateFunction(params) if err != nil { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) return } // Pretty-print the response data. fmt.Println(resp) }
Output:
func (*Lambda) CreateFunctionRequest ¶
func (c *Lambda) CreateFunctionRequest(input *CreateFunctionInput) (req *request.Request, output *FunctionConfiguration)
CreateFunctionRequest generates a request for the CreateFunction operation.
func (*Lambda) DeleteAlias ¶ added in v0.9.14
func (c *Lambda) DeleteAlias(input *DeleteAliasInput) (*DeleteAliasOutput, error)
Deletes specified Lambda function alias. For more information, see Introduction to AWS Lambda Aliases (http://docs.aws.amazon.com/lambda/latest/dg/versioning-v2-intro-aliases.html)
This requires permission for the lambda:DeleteAlias action.
Example ¶
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/lambda" ) func main() { svc := lambda.New(session.New()) params := &lambda.DeleteAliasInput{ FunctionName: aws.String("FunctionName"), // Required Name: aws.String("Alias"), // Required } resp, err := svc.DeleteAlias(params) if err != nil { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) return } // Pretty-print the response data. fmt.Println(resp) }
Output:
func (*Lambda) DeleteAliasRequest ¶ added in v0.9.14
func (c *Lambda) DeleteAliasRequest(input *DeleteAliasInput) (req *request.Request, output *DeleteAliasOutput)
DeleteAliasRequest generates a request for the DeleteAlias operation.
func (*Lambda) DeleteEventSourceMapping ¶
func (c *Lambda) DeleteEventSourceMapping(input *DeleteEventSourceMappingInput) (*EventSourceMappingConfiguration, error)
Removes an event source mapping. This means AWS Lambda will no longer invoke the function for events in the associated source.
This operation requires permission for the lambda:DeleteEventSourceMapping action.
Example ¶
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/lambda" ) func main() { svc := lambda.New(session.New()) params := &lambda.DeleteEventSourceMappingInput{ UUID: aws.String("String"), // Required } resp, err := svc.DeleteEventSourceMapping(params) if err != nil { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) return } // Pretty-print the response data. fmt.Println(resp) }
Output:
func (*Lambda) DeleteEventSourceMappingRequest ¶
func (c *Lambda) DeleteEventSourceMappingRequest(input *DeleteEventSourceMappingInput) (req *request.Request, output *EventSourceMappingConfiguration)
DeleteEventSourceMappingRequest generates a request for the DeleteEventSourceMapping operation.
func (*Lambda) DeleteFunction ¶
func (c *Lambda) DeleteFunction(input *DeleteFunctionInput) (*DeleteFunctionOutput, error)
Deletes the specified Lambda function code and configuration.
If you don't specify a function version, AWS Lambda will delete the function, including all its versions, and any aliases pointing to the function versions.
When you delete a function the associated resource policy is also deleted. You will need to delete the event source mappings explicitly.
For information about function versioning, see AWS Lambda Function Versioning and Aliases (http://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases-v2.html).
This operation requires permission for the lambda:DeleteFunction action.
Example ¶
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/lambda" ) func main() { svc := lambda.New(session.New()) params := &lambda.DeleteFunctionInput{ FunctionName: aws.String("FunctionName"), // Required Qualifier: aws.String("Qualifier"), } resp, err := svc.DeleteFunction(params) if err != nil { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) return } // Pretty-print the response data. fmt.Println(resp) }
Output:
func (*Lambda) DeleteFunctionRequest ¶
func (c *Lambda) DeleteFunctionRequest(input *DeleteFunctionInput) (req *request.Request, output *DeleteFunctionOutput)
DeleteFunctionRequest generates a request for the DeleteFunction operation.
func (*Lambda) GetAlias ¶ added in v0.9.14
func (c *Lambda) GetAlias(input *GetAliasInput) (*AliasConfiguration, error)
Returns the specified alias information such as the alias ARN, description, and function version it is pointing to. For more information, see Introduction to AWS Lambda Aliases (http://docs.aws.amazon.com/lambda/latest/dg/versioning-v2-intro-aliases.html)
This requires permission for the lambda:GetAlias action.
Example ¶
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/lambda" ) func main() { svc := lambda.New(session.New()) params := &lambda.GetAliasInput{ FunctionName: aws.String("FunctionName"), // Required Name: aws.String("Alias"), // Required } resp, err := svc.GetAlias(params) if err != nil { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) return } // Pretty-print the response data. fmt.Println(resp) }
Output:
func (*Lambda) GetAliasRequest ¶ added in v0.9.14
func (c *Lambda) GetAliasRequest(input *GetAliasInput) (req *request.Request, output *AliasConfiguration)
GetAliasRequest generates a request for the GetAlias operation.
func (*Lambda) GetEventSourceMapping ¶
func (c *Lambda) GetEventSourceMapping(input *GetEventSourceMappingInput) (*EventSourceMappingConfiguration, error)
Returns configuration information for the specified event source mapping (see CreateEventSourceMapping).
This operation requires permission for the lambda:GetEventSourceMapping action.
Example ¶
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/lambda" ) func main() { svc := lambda.New(session.New()) params := &lambda.GetEventSourceMappingInput{ UUID: aws.String("String"), // Required } resp, err := svc.GetEventSourceMapping(params) if err != nil { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) return } // Pretty-print the response data. fmt.Println(resp) }
Output:
func (*Lambda) GetEventSourceMappingRequest ¶
func (c *Lambda) GetEventSourceMappingRequest(input *GetEventSourceMappingInput) (req *request.Request, output *EventSourceMappingConfiguration)
GetEventSourceMappingRequest generates a request for the GetEventSourceMapping operation.
func (*Lambda) GetFunction ¶
func (c *Lambda) GetFunction(input *GetFunctionInput) (*GetFunctionOutput, error)
Returns the configuration information of the Lambda function and a presigned URL link to the .zip file you uploaded with CreateFunction so you can download the .zip file. Note that the URL is valid for up to 10 minutes. The configuration information is the same information you provided as parameters when uploading the function.
Using the optional Qualifier parameter, you can specify a specific function version for which you want this information. If you don't specify this parameter, the API uses unqualified function ARN which return information about the $LATEST version of the Lambda function. For more information, see AWS Lambda Function Versioning and Aliases (http://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases-v2.html).
This operation requires permission for the lambda:GetFunction action.
Example ¶
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/lambda" ) func main() { svc := lambda.New(session.New()) params := &lambda.GetFunctionInput{ FunctionName: aws.String("FunctionName"), // Required Qualifier: aws.String("Qualifier"), } resp, err := svc.GetFunction(params) if err != nil { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) return } // Pretty-print the response data. fmt.Println(resp) }
Output:
func (*Lambda) GetFunctionConfiguration ¶
func (c *Lambda) GetFunctionConfiguration(input *GetFunctionConfigurationInput) (*FunctionConfiguration, error)
Returns the configuration information of the Lambda function. This the same information you provided as parameters when uploading the function by using CreateFunction.
You can use the optional Qualifier parameter to retrieve configuration information for a specific Lambda function version. If you don't provide it, the API returns information about the $LATEST version of the function. For more information about versioning, see AWS Lambda Function Versioning and Aliases (http://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases-v2.html).
This operation requires permission for the lambda:GetFunctionConfiguration operation.
Example ¶
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/lambda" ) func main() { svc := lambda.New(session.New()) params := &lambda.GetFunctionConfigurationInput{ FunctionName: aws.String("FunctionName"), // Required Qualifier: aws.String("Qualifier"), } resp, err := svc.GetFunctionConfiguration(params) if err != nil { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) return } // Pretty-print the response data. fmt.Println(resp) }
Output:
func (*Lambda) GetFunctionConfigurationRequest ¶
func (c *Lambda) GetFunctionConfigurationRequest(input *GetFunctionConfigurationInput) (req *request.Request, output *FunctionConfiguration)
GetFunctionConfigurationRequest generates a request for the GetFunctionConfiguration operation.
func (*Lambda) GetFunctionRequest ¶
func (c *Lambda) GetFunctionRequest(input *GetFunctionInput) (req *request.Request, output *GetFunctionOutput)
GetFunctionRequest generates a request for the GetFunction operation.
func (*Lambda) GetPolicy ¶
func (c *Lambda) GetPolicy(input *GetPolicyInput) (*GetPolicyOutput, error)
Returns the resource policy, containing a list of permissions that apply to a specific to an ARN that you specify via the Qualifier paramter.
For informration about adding permissions, see AddPermission.
You need permission for the lambda:GetPolicy action.
Example ¶
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/lambda" ) func main() { svc := lambda.New(session.New()) params := &lambda.GetPolicyInput{ FunctionName: aws.String("FunctionName"), // Required Qualifier: aws.String("Qualifier"), } resp, err := svc.GetPolicy(params) if err != nil { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) return } // Pretty-print the response data. fmt.Println(resp) }
Output:
func (*Lambda) GetPolicyRequest ¶
func (c *Lambda) GetPolicyRequest(input *GetPolicyInput) (req *request.Request, output *GetPolicyOutput)
GetPolicyRequest generates a request for the GetPolicy operation.
func (*Lambda) Invoke ¶
func (c *Lambda) Invoke(input *InvokeInput) (*InvokeOutput, error)
Invokes a specific Lambda function version.
If you don't provide the Qualifier parameter, it uses the unqualified function ARN which results in invocation of the $LATEST version of the Lambda function (when you create a Lambda function, the $LATEST is the version). The AWS Lambda versioning and aliases feature allows you to publish multiple versions of a Lambda function and also create aliases for each function version. So each your Lambda function version can be invoked using multiple ARNs. For more information, see AWS Lambda Function Versioning and Aliases (http://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases-v2.html). Using the Qualifier parameter, you can specify a function version or alias name to invoke specific function version. If you specify function version, the API uses the qualified function ARN to invoke a specific function version. If you specify alias name, the API uses the alias ARN to invoke the function version to which the alias points.
This operation requires permission for the lambda:InvokeFunction action.
Example ¶
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/lambda" ) func main() { svc := lambda.New(session.New()) params := &lambda.InvokeInput{ FunctionName: aws.String("FunctionName"), // Required ClientContext: aws.String("String"), InvocationType: aws.String("InvocationType"), LogType: aws.String("LogType"), Payload: []byte("PAYLOAD"), Qualifier: aws.String("Qualifier"), } resp, err := svc.Invoke(params) if err != nil { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) return } // Pretty-print the response data. fmt.Println(resp) }
Output:
func (*Lambda) InvokeAsync ¶
func (c *Lambda) InvokeAsync(input *InvokeAsyncInput) (*InvokeAsyncOutput, error)
This API is deprecated. We recommend you use Invoke API (see Invoke). Submits an invocation request to AWS Lambda. Upon receiving the request, Lambda executes the specified function asynchronously. To see the logs generated by the Lambda function execution, see the CloudWatch logs console.
This operation requires permission for the lambda:InvokeFunction action.
Example ¶
package main import ( "bytes" "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/lambda" ) func main() { svc := lambda.New(session.New()) params := &lambda.InvokeAsyncInput{ FunctionName: aws.String("FunctionName"), // Required InvokeArgs: bytes.NewReader([]byte("PAYLOAD")), // Required } resp, err := svc.InvokeAsync(params) if err != nil { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) return } // Pretty-print the response data. fmt.Println(resp) }
Output:
func (*Lambda) InvokeAsyncRequest ¶
func (c *Lambda) InvokeAsyncRequest(input *InvokeAsyncInput) (req *request.Request, output *InvokeAsyncOutput)
InvokeAsyncRequest generates a request for the InvokeAsync operation.
func (*Lambda) InvokeRequest ¶
func (c *Lambda) InvokeRequest(input *InvokeInput) (req *request.Request, output *InvokeOutput)
InvokeRequest generates a request for the Invoke operation.
func (*Lambda) ListAliases ¶ added in v0.9.14
func (c *Lambda) ListAliases(input *ListAliasesInput) (*ListAliasesOutput, error)
Returns list of aliases created for a Lambda function. For each alias, the response includes information such as the alias ARN, description, alias name, and the function version to which it points. For more information, see Introduction to AWS Lambda Aliases (http://docs.aws.amazon.com/lambda/latest/dg/versioning-v2-intro-aliases.html)
This requires permission for the lambda:ListAliases action.
Example ¶
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/lambda" ) func main() { svc := lambda.New(session.New()) params := &lambda.ListAliasesInput{ FunctionName: aws.String("FunctionName"), // Required FunctionVersion: aws.String("Version"), Marker: aws.String("String"), MaxItems: aws.Int64(1), } resp, err := svc.ListAliases(params) if err != nil { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) return } // Pretty-print the response data. fmt.Println(resp) }
Output:
func (*Lambda) ListAliasesRequest ¶ added in v0.9.14
func (c *Lambda) ListAliasesRequest(input *ListAliasesInput) (req *request.Request, output *ListAliasesOutput)
ListAliasesRequest generates a request for the ListAliases operation.
func (*Lambda) ListEventSourceMappings ¶
func (c *Lambda) ListEventSourceMappings(input *ListEventSourceMappingsInput) (*ListEventSourceMappingsOutput, error)
Returns a list of event source mappings you created using the CreateEventSourceMapping (see CreateEventSourceMapping), where you identify a stream as an event source. This list does not include Amazon S3 event sources.
For each mapping, the API returns configuration information. You can optionally specify filters to retrieve specific event source mappings.
This operation requires permission for the lambda:ListEventSourceMappings action.
Example ¶
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/lambda" ) func main() { svc := lambda.New(session.New()) params := &lambda.ListEventSourceMappingsInput{ EventSourceArn: aws.String("Arn"), FunctionName: aws.String("FunctionName"), Marker: aws.String("String"), MaxItems: aws.Int64(1), } resp, err := svc.ListEventSourceMappings(params) if err != nil { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) return } // Pretty-print the response data. fmt.Println(resp) }
Output:
func (*Lambda) ListEventSourceMappingsPages ¶
func (c *Lambda) ListEventSourceMappingsPages(input *ListEventSourceMappingsInput, fn func(p *ListEventSourceMappingsOutput, lastPage bool) (shouldContinue bool)) error
func (*Lambda) ListEventSourceMappingsRequest ¶
func (c *Lambda) ListEventSourceMappingsRequest(input *ListEventSourceMappingsInput) (req *request.Request, output *ListEventSourceMappingsOutput)
ListEventSourceMappingsRequest generates a request for the ListEventSourceMappings operation.
func (*Lambda) ListFunctions ¶
func (c *Lambda) ListFunctions(input *ListFunctionsInput) (*ListFunctionsOutput, error)
Returns a list of your Lambda functions. For each function, the response includes the function configuration information. You must use GetFunction to retrieve the code for your function.
This operation requires permission for the lambda:ListFunctions action.
Example ¶
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/lambda" ) func main() { svc := lambda.New(session.New()) params := &lambda.ListFunctionsInput{ Marker: aws.String("String"), MaxItems: aws.Int64(1), } resp, err := svc.ListFunctions(params) if err != nil { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) return } // Pretty-print the response data. fmt.Println(resp) }
Output:
func (*Lambda) ListFunctionsPages ¶
func (c *Lambda) ListFunctionsPages(input *ListFunctionsInput, fn func(p *ListFunctionsOutput, lastPage bool) (shouldContinue bool)) error
func (*Lambda) ListFunctionsRequest ¶
func (c *Lambda) ListFunctionsRequest(input *ListFunctionsInput) (req *request.Request, output *ListFunctionsOutput)
ListFunctionsRequest generates a request for the ListFunctions operation.
func (*Lambda) ListVersionsByFunction ¶ added in v0.9.14
func (c *Lambda) ListVersionsByFunction(input *ListVersionsByFunctionInput) (*ListVersionsByFunctionOutput, error)
List all versions of a function.
Example ¶
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/lambda" ) func main() { svc := lambda.New(session.New()) params := &lambda.ListVersionsByFunctionInput{ FunctionName: aws.String("FunctionName"), // Required Marker: aws.String("String"), MaxItems: aws.Int64(1), } resp, err := svc.ListVersionsByFunction(params) if err != nil { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) return } // Pretty-print the response data. fmt.Println(resp) }
Output:
func (*Lambda) ListVersionsByFunctionRequest ¶ added in v0.9.14
func (c *Lambda) ListVersionsByFunctionRequest(input *ListVersionsByFunctionInput) (req *request.Request, output *ListVersionsByFunctionOutput)
ListVersionsByFunctionRequest generates a request for the ListVersionsByFunction operation.
func (*Lambda) PublishVersion ¶ added in v0.9.14
func (c *Lambda) PublishVersion(input *PublishVersionInput) (*FunctionConfiguration, error)
Publishes a version of your function from the current snapshot of HEAD. That is, AWS Lambda takes a snapshot of the function code and configuration information from HEAD and publishes a new version. The code and handler of this specific Lambda function version cannot be modified after publication, but you can modify the configuration information.
Example ¶
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/lambda" ) func main() { svc := lambda.New(session.New()) params := &lambda.PublishVersionInput{ FunctionName: aws.String("FunctionName"), // Required CodeSha256: aws.String("String"), Description: aws.String("Description"), } resp, err := svc.PublishVersion(params) if err != nil { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) return } // Pretty-print the response data. fmt.Println(resp) }
Output:
func (*Lambda) PublishVersionRequest ¶ added in v0.9.14
func (c *Lambda) PublishVersionRequest(input *PublishVersionInput) (req *request.Request, output *FunctionConfiguration)
PublishVersionRequest generates a request for the PublishVersion operation.
func (*Lambda) RemovePermission ¶
func (c *Lambda) RemovePermission(input *RemovePermissionInput) (*RemovePermissionOutput, error)
You can remove individual permissions from an resource policy associated with a Lambda function by providing a statement ID that you provided when you addded the permission. The API removes corresponding permission that is associated with the specific ARN identified by the Qualifier parameter.
Note that removal of a permission will cause an active event source to lose permission to the function.
You need permission for the lambda:RemovePermission action.
Example ¶
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/lambda" ) func main() { svc := lambda.New(session.New()) params := &lambda.RemovePermissionInput{ FunctionName: aws.String("FunctionName"), // Required StatementId: aws.String("StatementId"), // Required Qualifier: aws.String("Qualifier"), } resp, err := svc.RemovePermission(params) if err != nil { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) return } // Pretty-print the response data. fmt.Println(resp) }
Output:
func (*Lambda) RemovePermissionRequest ¶
func (c *Lambda) RemovePermissionRequest(input *RemovePermissionInput) (req *request.Request, output *RemovePermissionOutput)
RemovePermissionRequest generates a request for the RemovePermission operation.
func (*Lambda) UpdateAlias ¶ added in v0.9.14
func (c *Lambda) UpdateAlias(input *UpdateAliasInput) (*AliasConfiguration, error)
Using this API you can update function version to which the alias points to and alias description. For more information, see Introduction to AWS Lambda Aliases (http://docs.aws.amazon.com/lambda/latest/dg/versioning-v2-intro-aliases.html)
This requires permission for the lambda:UpdateAlias action.
Example ¶
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/lambda" ) func main() { svc := lambda.New(session.New()) params := &lambda.UpdateAliasInput{ FunctionName: aws.String("FunctionName"), // Required Name: aws.String("Alias"), // Required Description: aws.String("Description"), FunctionVersion: aws.String("Version"), } resp, err := svc.UpdateAlias(params) if err != nil { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) return } // Pretty-print the response data. fmt.Println(resp) }
Output:
func (*Lambda) UpdateAliasRequest ¶ added in v0.9.14
func (c *Lambda) UpdateAliasRequest(input *UpdateAliasInput) (req *request.Request, output *AliasConfiguration)
UpdateAliasRequest generates a request for the UpdateAlias operation.
func (*Lambda) UpdateEventSourceMapping ¶
func (c *Lambda) UpdateEventSourceMapping(input *UpdateEventSourceMappingInput) (*EventSourceMappingConfiguration, error)
You can update an event source mapping. This is useful if you want to change the parameters of the existing mapping without losing your position in the stream. You can change which function will receive the stream records, but to change the stream itself, you must create a new mapping.
This operation requires permission for the lambda:UpdateEventSourceMapping action.
Example ¶
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/lambda" ) func main() { svc := lambda.New(session.New()) params := &lambda.UpdateEventSourceMappingInput{ UUID: aws.String("String"), // Required BatchSize: aws.Int64(1), Enabled: aws.Bool(true), FunctionName: aws.String("FunctionName"), } resp, err := svc.UpdateEventSourceMapping(params) if err != nil { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) return } // Pretty-print the response data. fmt.Println(resp) }
Output:
func (*Lambda) UpdateEventSourceMappingRequest ¶
func (c *Lambda) UpdateEventSourceMappingRequest(input *UpdateEventSourceMappingInput) (req *request.Request, output *EventSourceMappingConfiguration)
UpdateEventSourceMappingRequest generates a request for the UpdateEventSourceMapping operation.
func (*Lambda) UpdateFunctionCode ¶
func (c *Lambda) UpdateFunctionCode(input *UpdateFunctionCodeInput) (*FunctionConfiguration, error)
Updates the code for the specified Lambda function. This operation must only be used on an existing Lambda function and cannot be used to update the function configuration.
This operation requires permission for the lambda:UpdateFunctionCode action.
Example ¶
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/lambda" ) func main() { svc := lambda.New(session.New()) params := &lambda.UpdateFunctionCodeInput{ FunctionName: aws.String("FunctionName"), // Required Publish: aws.Bool(true), S3Bucket: aws.String("S3Bucket"), S3Key: aws.String("S3Key"), S3ObjectVersion: aws.String("S3ObjectVersion"), ZipFile: []byte("PAYLOAD"), } resp, err := svc.UpdateFunctionCode(params) if err != nil { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) return } // Pretty-print the response data. fmt.Println(resp) }
Output:
func (*Lambda) UpdateFunctionCodeRequest ¶
func (c *Lambda) UpdateFunctionCodeRequest(input *UpdateFunctionCodeInput) (req *request.Request, output *FunctionConfiguration)
UpdateFunctionCodeRequest generates a request for the UpdateFunctionCode operation.
func (*Lambda) UpdateFunctionConfiguration ¶
func (c *Lambda) UpdateFunctionConfiguration(input *UpdateFunctionConfigurationInput) (*FunctionConfiguration, error)
Updates the configuration parameters for the specified Lambda function by using the values provided in the request. You provide only the parameters you want to change. This operation must only be used on an existing Lambda function and cannot be used to update the function's code.
This operation requires permission for the lambda:UpdateFunctionConfiguration action.
Example ¶
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/lambda" ) func main() { svc := lambda.New(session.New()) params := &lambda.UpdateFunctionConfigurationInput{ FunctionName: aws.String("FunctionName"), // Required Description: aws.String("Description"), Handler: aws.String("Handler"), MemorySize: aws.Int64(1), Role: aws.String("RoleArn"), Timeout: aws.Int64(1), } resp, err := svc.UpdateFunctionConfiguration(params) if err != nil { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) return } // Pretty-print the response data. fmt.Println(resp) }
Output:
func (*Lambda) UpdateFunctionConfigurationRequest ¶
func (c *Lambda) UpdateFunctionConfigurationRequest(input *UpdateFunctionConfigurationInput) (req *request.Request, output *FunctionConfiguration)
UpdateFunctionConfigurationRequest generates a request for the UpdateFunctionConfiguration operation.
type ListAliasesInput ¶ added in v0.9.14
type ListAliasesInput struct { // Lambda function name for which the alias is created. FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"` // If you specify this optional parameter, the API returns only the aliases // pointing to the specific Lambda function version, otherwise returns all aliases // created for the Lambda function. FunctionVersion *string `location:"querystring" locationName:"FunctionVersion" min:"1" type:"string"` // Optional string. An opaque pagination token returned from a previous ListAliases // operation. If present, indicates where to continue the listing. Marker *string `location:"querystring" locationName:"Marker" type:"string"` // Optional integer. Specifies the maximum number of aliases to return in response. // This parameter value must be greater than 0. MaxItems *int64 `location:"querystring" locationName:"MaxItems" min:"1" type:"integer"` // contains filtered or unexported fields }
func (ListAliasesInput) GoString ¶ added in v0.9.14
func (s ListAliasesInput) GoString() string
GoString returns the string representation
func (ListAliasesInput) String ¶ added in v0.9.14
func (s ListAliasesInput) String() string
String returns the string representation
type ListAliasesOutput ¶ added in v0.9.14
type ListAliasesOutput struct { // An list of alises. Aliases []*AliasConfiguration `type:"list"` // A string, present if there are more aliases. NextMarker *string `type:"string"` // contains filtered or unexported fields }
func (ListAliasesOutput) GoString ¶ added in v0.9.14
func (s ListAliasesOutput) GoString() string
GoString returns the string representation
func (ListAliasesOutput) String ¶ added in v0.9.14
func (s ListAliasesOutput) String() string
String returns the string representation
type ListEventSourceMappingsInput ¶
type ListEventSourceMappingsInput struct { // The Amazon Resource Name (ARN) of the Amazon Kinesis stream. EventSourceArn *string `location:"querystring" locationName:"EventSourceArn" type:"string"` // The name of the Lambda function. // // You can specify an unqualified function name (for example, "Thumbnail") // or you can specify Amazon Resource Name (ARN) of the function (for example, // "arn:aws:lambda:us-west-2:account-id:function:ThumbNail"). AWS Lambda also // allows you to specify only the account ID qualifier (for example, "account-id:Thumbnail"). // Note that the length constraint applies only to the ARN. If you specify only // the function name, it is limited to 64 character in length. FunctionName *string `location:"querystring" locationName:"FunctionName" min:"1" type:"string"` // Optional string. An opaque pagination token returned from a previous ListEventSourceMappings // operation. If present, specifies to continue the list from where the returning // call left off. Marker *string `location:"querystring" locationName:"Marker" type:"string"` // Optional integer. Specifies the maximum number of event sources to return // in response. This value must be greater than 0. MaxItems *int64 `location:"querystring" locationName:"MaxItems" min:"1" type:"integer"` // contains filtered or unexported fields }
func (ListEventSourceMappingsInput) GoString ¶ added in v0.6.5
func (s ListEventSourceMappingsInput) GoString() string
GoString returns the string representation
func (ListEventSourceMappingsInput) String ¶ added in v0.6.5
func (s ListEventSourceMappingsInput) String() string
String returns the string representation
type ListEventSourceMappingsOutput ¶
type ListEventSourceMappingsOutput struct { // An array of EventSourceMappingConfiguration objects. EventSourceMappings []*EventSourceMappingConfiguration `type:"list"` // A string, present if there are more event source mappings. NextMarker *string `type:"string"` // contains filtered or unexported fields }
Contains a list of event sources (see API_EventSourceMappingConfiguration)
func (ListEventSourceMappingsOutput) GoString ¶ added in v0.6.5
func (s ListEventSourceMappingsOutput) GoString() string
GoString returns the string representation
func (ListEventSourceMappingsOutput) String ¶ added in v0.6.5
func (s ListEventSourceMappingsOutput) String() string
String returns the string representation
type ListFunctionsInput ¶
type ListFunctionsInput struct { // Optional string. An opaque pagination token returned from a previous ListFunctions // operation. If present, indicates where to continue the listing. Marker *string `location:"querystring" locationName:"Marker" type:"string"` // Optional integer. Specifies the maximum number of AWS Lambda functions to // return in response. This parameter value must be greater than 0. MaxItems *int64 `location:"querystring" locationName:"MaxItems" min:"1" type:"integer"` // contains filtered or unexported fields }
func (ListFunctionsInput) GoString ¶ added in v0.6.5
func (s ListFunctionsInput) GoString() string
GoString returns the string representation
func (ListFunctionsInput) String ¶ added in v0.6.5
func (s ListFunctionsInput) String() string
String returns the string representation
type ListFunctionsOutput ¶
type ListFunctionsOutput struct { // A list of Lambda functions. Functions []*FunctionConfiguration `type:"list"` // A string, present if there are more functions. NextMarker *string `type:"string"` // contains filtered or unexported fields }
Contains a list of AWS Lambda function configurations (see FunctionConfiguration.
func (ListFunctionsOutput) GoString ¶ added in v0.6.5
func (s ListFunctionsOutput) GoString() string
GoString returns the string representation
func (ListFunctionsOutput) String ¶ added in v0.6.5
func (s ListFunctionsOutput) String() string
String returns the string representation
type ListVersionsByFunctionInput ¶ added in v0.9.14
type ListVersionsByFunctionInput struct { // Function name whose versions to list. You can specify an unqualified function // name (for example, "Thumbnail") or you can specify Amazon Resource Name (ARN) // of the function (for example, "arn:aws:lambda:us-west-2:account-id:function:ThumbNail"). // AWS Lambda also allows you to specify only the account ID qualifier (for // example, "account-id:Thumbnail"). Note that the length constraint applies // only to the ARN. If you specify only the function name, it is limited to // 64 character in length. FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"` // Optional string. An opaque pagination token returned from a previous ListVersionsByFunction // operation. If present, indicates where to continue the listing. Marker *string `location:"querystring" locationName:"Marker" type:"string"` // Optional integer. Specifies the maximum number of AWS Lambda function versions // to return in response. This parameter value must be greater than 0. MaxItems *int64 `location:"querystring" locationName:"MaxItems" min:"1" type:"integer"` // contains filtered or unexported fields }
func (ListVersionsByFunctionInput) GoString ¶ added in v0.9.14
func (s ListVersionsByFunctionInput) GoString() string
GoString returns the string representation
func (ListVersionsByFunctionInput) String ¶ added in v0.9.14
func (s ListVersionsByFunctionInput) String() string
String returns the string representation
type ListVersionsByFunctionOutput ¶ added in v0.9.14
type ListVersionsByFunctionOutput struct { // A string, present if there are more function versions. NextMarker *string `type:"string"` // A list of Lambda function versions. Versions []*FunctionConfiguration `type:"list"` // contains filtered or unexported fields }
func (ListVersionsByFunctionOutput) GoString ¶ added in v0.9.14
func (s ListVersionsByFunctionOutput) GoString() string
GoString returns the string representation
func (ListVersionsByFunctionOutput) String ¶ added in v0.9.14
func (s ListVersionsByFunctionOutput) String() string
String returns the string representation
type PublishVersionInput ¶ added in v0.9.14
type PublishVersionInput struct { // The SHA256 hash of the deployment package you want to publish. This provides // validation on the code you are publishing. If you provide this parameter // value must match the SHA256 of the HEAD version for the publication to succeed. CodeSha256 *string `type:"string"` // The description for the version you are publishing. If not provided, AWS // Lambda copies the description from the HEAD version. Description *string `type:"string"` // The Lambda function name. You can specify an unqualified function name (for // example, "Thumbnail") or you can specify Amazon Resource Name (ARN) of the // function (for example, "arn:aws:lambda:us-west-2:account-id:function:ThumbNail"). // AWS Lambda also allows you to specify only the account ID qualifier (for // example, "account-id:Thumbnail"). Note that the length constraint applies // only to the ARN. If you specify only the function name, it is limited to // 64 character in length. FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"` // contains filtered or unexported fields }
func (PublishVersionInput) GoString ¶ added in v0.9.14
func (s PublishVersionInput) GoString() string
GoString returns the string representation
func (PublishVersionInput) String ¶ added in v0.9.14
func (s PublishVersionInput) String() string
String returns the string representation
type RemovePermissionInput ¶
type RemovePermissionInput struct { // Lambda function whose resource policy you want to remove a permission from. // // You can specify an unqualified function name (for example, "Thumbnail") // or you can specify Amazon Resource Name (ARN) of the function (for example, // "arn:aws:lambda:us-west-2:account-id:function:ThumbNail"). AWS Lambda also // allows you to specify only the account ID qualifier (for example, "account-id:Thumbnail"). // Note that the length constraint applies only to the ARN. If you specify only // the function name, it is limited to 64 character in length. FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"` // You can specify this optional parameter to remove permission associated with // a specific function version or function alias. The value of this paramter // is the function version or alias name. If you don't specify this parameter, // the API removes permission associated with the unqualified function ARN. Qualifier *string `location:"querystring" locationName:"Qualifier" min:"1" type:"string"` // Statement ID of the permission to remove. StatementId *string `location:"uri" locationName:"StatementId" min:"1" type:"string" required:"true"` // contains filtered or unexported fields }
func (RemovePermissionInput) GoString ¶ added in v0.6.5
func (s RemovePermissionInput) GoString() string
GoString returns the string representation
func (RemovePermissionInput) String ¶ added in v0.6.5
func (s RemovePermissionInput) String() string
String returns the string representation
type RemovePermissionOutput ¶
type RemovePermissionOutput struct {
// contains filtered or unexported fields
}
func (RemovePermissionOutput) GoString ¶ added in v0.6.5
func (s RemovePermissionOutput) GoString() string
GoString returns the string representation
func (RemovePermissionOutput) String ¶ added in v0.6.5
func (s RemovePermissionOutput) String() string
String returns the string representation
type UpdateAliasInput ¶ added in v0.9.14
type UpdateAliasInput struct { // You can optionally change the description of the alias using this parameter. Description *string `type:"string"` // The function name for which the alias is created. FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"` // Using this parameter you can optionally change the Lambda function version // to which the alias to points to. FunctionVersion *string `min:"1" type:"string"` // The alias name. Name *string `location:"uri" locationName:"Name" min:"1" type:"string" required:"true"` // contains filtered or unexported fields }
func (UpdateAliasInput) GoString ¶ added in v0.9.14
func (s UpdateAliasInput) GoString() string
GoString returns the string representation
func (UpdateAliasInput) String ¶ added in v0.9.14
func (s UpdateAliasInput) String() string
String returns the string representation
type UpdateEventSourceMappingInput ¶
type UpdateEventSourceMappingInput struct { // The maximum number of stream records that can be sent to your Lambda function // for a single invocation. BatchSize *int64 `min:"1" type:"integer"` // Specifies whether AWS Lambda should actively poll the stream or not. If disabled, // AWS Lambda will not poll the stream. Enabled *bool `type:"boolean"` // The Lambda function to which you want the stream records sent. // // You can specify an unqualified function name (for example, "Thumbnail") // or you can specify Amazon Resource Name (ARN) of the function (for example, // "arn:aws:lambda:us-west-2:account-id:function:ThumbNail"). AWS Lambda also // allows you to specify only the account ID qualifier (for example, "account-id:Thumbnail"). // Note that the length constraint applies only to the ARN. If you specify only // the function name, it is limited to 64 character in length. FunctionName *string `min:"1" type:"string"` // The event source mapping identifier. UUID *string `location:"uri" locationName:"UUID" type:"string" required:"true"` // contains filtered or unexported fields }
func (UpdateEventSourceMappingInput) GoString ¶ added in v0.6.5
func (s UpdateEventSourceMappingInput) GoString() string
GoString returns the string representation
func (UpdateEventSourceMappingInput) String ¶ added in v0.6.5
func (s UpdateEventSourceMappingInput) String() string
String returns the string representation
type UpdateFunctionCodeInput ¶
type UpdateFunctionCodeInput struct { // The existing Lambda function name whose code you want to replace. // // You can specify an unqualified function name (for example, "Thumbnail") // or you can specify Amazon Resource Name (ARN) of the function (for example, // "arn:aws:lambda:us-west-2:account-id:function:ThumbNail"). AWS Lambda also // allows you to specify only the account ID qualifier (for example, "account-id:Thumbnail"). // Note that the length constraint applies only to the ARN. If you specify only // the function name, it is limited to 64 character in length. FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"` // This boolean parameter can be used to request AWS Lambda to update the Lambda // function and publish a version as an atomic operation. Publish *bool `type:"boolean"` // Amazon S3 bucket name where the .zip file containing your deployment package // is stored. This bucket must reside in the same AWS region where you are creating // the Lambda function. S3Bucket *string `min:"3" type:"string"` // The Amazon S3 object (the deployment package) key name you want to upload. S3Key *string `min:"1" type:"string"` // The Amazon S3 object (the deployment package) version you want to upload. S3ObjectVersion *string `min:"1" type:"string"` // Based64-encoded .zip file containing your packaged source code. ZipFile []byte `type:"blob"` // contains filtered or unexported fields }
func (UpdateFunctionCodeInput) GoString ¶ added in v0.6.5
func (s UpdateFunctionCodeInput) GoString() string
GoString returns the string representation
func (UpdateFunctionCodeInput) String ¶ added in v0.6.5
func (s UpdateFunctionCodeInput) String() string
String returns the string representation
type UpdateFunctionConfigurationInput ¶
type UpdateFunctionConfigurationInput struct { // A short user-defined function description. AWS Lambda does not use this value. // Assign a meaningful description as you see fit. Description *string `type:"string"` // The name of the Lambda function. // // You can specify an unqualified function name (for example, "Thumbnail") // or you can specify Amazon Resource Name (ARN) of the function (for example, // "arn:aws:lambda:us-west-2:account-id:function:ThumbNail"). AWS Lambda also // allows you to specify only the account ID qualifier (for example, "account-id:Thumbnail"). // Note that the length constraint applies only to the ARN. If you specify only // the function name, it is limited to 64 character in length. FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"` // The function that Lambda calls to begin executing your function. For Node.js, // it is the module-name.export value in your function. Handler *string `type:"string"` // The amount of memory, in MB, your Lambda function is given. AWS Lambda uses // this memory size to infer the amount of CPU allocated to your function. Your // function use-case determines your CPU and memory requirements. For example, // a database operation might need less memory compared to an image processing // function. The default value is 128 MB. The value must be a multiple of 64 // MB. MemorySize *int64 `min:"128" type:"integer"` // The Amazon Resource Name (ARN) of the IAM role that Lambda will assume when // it executes your function. Role *string `type:"string"` // The function execution time at which AWS Lambda should terminate the function. // Because the execution time has cost implications, we recommend you set this // value based on your expected execution time. The default is 3 seconds. Timeout *int64 `min:"1" type:"integer"` // contains filtered or unexported fields }
func (UpdateFunctionConfigurationInput) GoString ¶ added in v0.6.5
func (s UpdateFunctionConfigurationInput) GoString() string
GoString returns the string representation
func (UpdateFunctionConfigurationInput) String ¶ added in v0.6.5
func (s UpdateFunctionConfigurationInput) String() string
String returns the string representation
Directories ¶
Path | Synopsis |
---|---|
Package lambdaiface provides an interface for the AWS Lambda.
|
Package lambdaiface provides an interface for the AWS Lambda. |