AWS SDK for Go (PILOT)
API Reference

PREVIEW DOCUMENTATION - This is a preview of a new format for the AWS SDK for Go API Reference documentation. For the current AWS SDK for Go API Reference, see https://docs.aws.amazon.com/sdk-for-go/api/.

We welcome your feedback on this new version of the documentation. Send your comments to aws-sdkdocs-feedback@amazon.com.

AddPermissionInput

import "github.com/aws/aws-sdk-go/service/lambda"

type AddPermissionInput struct { Action *string `type:"string" required:"true"` EventSourceToken *string `type:"string"` FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"` Principal *string `type:"string" required:"true"` Qualifier *string `location:"querystring" locationName:"Qualifier" min:"1" type:"string"` RevisionId *string `type:"string"` SourceAccount *string `type:"string"` SourceArn *string `type:"string"` StatementId *string `min:"1" type:"string" required:"true"` }

Action

Type: *string

The action that the principal can use on the function. For example, lambda:InvokeFunction or lambda:GetFunction.

Action is a required field

EventSourceToken

Type: *string

For Alexa Smart Home functions, a token that must be supplied by the invoker.

FunctionName

Type: *string

The name of the Lambda function, version, or alias.

Name formats

  • Function name - my-function (name-only), my-function:v1 (with alias).

  • Function ARN - arn:aws:lambda:us-west-2:123456789012:function:my-function.

  • Partial ARN - 123456789012:function:my-function.

You can append a version number or alias to any of the formats. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

FunctionName is a required field

Principal

Type: *string

The AWS service or account that invokes the function. If you specify a service, use SourceArn or SourceAccount to limit who can invoke the function through that service.

Principal is a required field

Qualifier

Type: *string

Specify a version or alias to add permissions to a published version of the function.

RevisionId

Type: *string

Only update the policy if the revision ID matches the ID that's specified. Use this option to avoid modifying a policy that has changed since you last read it.

SourceAccount

Type: *string

For AWS services, the ID of the account that owns the resource. Use this instead of SourceArn to grant permission to resources that are owned by another account (for example, all of an account's Amazon S3 buckets). Or use it together with SourceArn to ensure that the resource is owned by the specified account. For example, an Amazon S3 bucket could be deleted by its owner and recreated by another account.

SourceArn

Type: *string

For AWS services, the ARN of the AWS resource that invokes the function. For example, an Amazon S3 bucket or Amazon SNS topic.

StatementId

Type: *string

A statement identifier that differentiates the statement from others in the same policy.

StatementId is a required field

Method

GoString

func (s AddPermissionInput) GoString() string

GoString returns the string representation

SetAction

func (s *AddPermissionInput) SetAction(v string) *AddPermissionInput

SetAction sets the Action field's value.

SetEventSourceToken

func (s *AddPermissionInput) SetEventSourceToken(v string) *AddPermissionInput

SetEventSourceToken sets the EventSourceToken field's value.

SetFunctionName

func (s *AddPermissionInput) SetFunctionName(v string) *AddPermissionInput

SetFunctionName sets the FunctionName field's value.

SetPrincipal

func (s *AddPermissionInput) SetPrincipal(v string) *AddPermissionInput

SetPrincipal sets the Principal field's value.

SetQualifier

func (s *AddPermissionInput) SetQualifier(v string) *AddPermissionInput

SetQualifier sets the Qualifier field's value.

SetRevisionId

func (s *AddPermissionInput) SetRevisionId(v string) *AddPermissionInput

SetRevisionId sets the RevisionId field's value.

SetSourceAccount

func (s *AddPermissionInput) SetSourceAccount(v string) *AddPermissionInput

SetSourceAccount sets the SourceAccount field's value.

SetSourceArn

func (s *AddPermissionInput) SetSourceArn(v string) *AddPermissionInput

SetSourceArn sets the SourceArn field's value.

SetStatementId

func (s *AddPermissionInput) SetStatementId(v string) *AddPermissionInput

SetStatementId sets the StatementId field's value.

String

func (s AddPermissionInput) String() string

String returns the string representation

Validate

func (s *AddPermissionInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

On this page: