// Grants an AWS service or another account permission to use a function. You can
// apply the policy at the function level, or specify a qualifier to restrict
// access to a single version or alias. If you use a qualifier, the invoker must
// use the full Amazon Resource Name (ARN) of that version or alias to invoke the
// function. To grant permission to another account, specify the account ID as the
// Principal. For AWS services, the principal is a domain-style identifier defined
// by the service, like s3.amazonaws.com or sns.amazonaws.com. For AWS services,
// you can also specify the ARN of the associated resource as the SourceArn. If you
// grant permission to a service principal without specifying the source, other
// accounts could potentially configure resources in their account to invoke your
// Lambda function. This action adds a statement to a resource-based permissions
// policy for the function. For more information about function policies, see
// Lambda Function Policies
// (https://docs.aws.amazon.com/lambda/latest/dg/access-control-resource-based.html).
Grants an AWS service or another account permission to use a function. You can
apply the policy at the function level, or specify a qualifier to restrict
access to a single version or alias. If you use a qualifier, the invoker must
use the full Amazon Resource Name (ARN) of that version or alias to invoke the
function. To grant permission to another account, specify the account ID as the
Principal. For AWS services, the principal is a domain-style identifier defined
by the service, like s3.amazonaws.com or sns.amazonaws.com. For AWS services,
you can also specify the ARN of the associated resource as the SourceArn. If you
grant permission to a service principal without specifying the source, other
accounts could potentially configure resources in their account to invoke your
Lambda function. This action adds a statement to a resource-based permissions
policy for the function. For more information about function policies, see
Lambda Function Policies
.
// Grants an AWS service or another account permission to use a function . You can // apply the policy at the function level or specify a qualifier to restrict // access to a single version or alias . If you use a qualifier the invoker must // use the full Amazon Resource Name ( ARN ) of that version or alias to invoke the // function . To grant permission to another account specify the account ID as the // Principal . For AWS services the principal is a domain - style identifier defined // by the service like s3 . amazonaws . com or sns . amazonaws . com . For AWS services // you can also specify the ARN of the associated resource as the SourceArn . If you // grant permission to a service principal without specifying the source other // accounts could potentially configure resources in their account to invoke your // Lambda function . This action adds a statement to a resource - based permissions // policy for the function . For more information about function policies see // Lambda Function Policies // ( https : // docs . aws . amazon . com / lambda / latest / dg / access - control - resource - based . html ) .
func (c *Client) AddPermission(ctx context.Context, params *AddPermissionInput, optFns ...func(*Options)) (*AddPermissionOutput, error) {
	if params == nil {
		params = &AddPermissionInput{}
	}
	result, metadata, err := c.invokeOperation(ctx, "AddPermission", params, optFns, addOperationAddPermissionMiddlewares)
	if err != nil {
		return nil, err
	}
	out := result.(*AddPermissionOutput)
	out.ResultMetadata = metadata
	return out, nil
}
func ( c * Client ) AddPermission ( ctx context . Context , params * AddPermissionInput , optFns ... func ( * Options ) ) ( * AddPermissionOutput , error ) { if params == nil { params = & AddPermissionInput { } } result , metadata , err := c . invokeOperation ( ctx , " " , params , optFns , addOperationAddPermissionMiddlewares ) if err != nil { return nil , err } out := result . ( * AddPermissionOutput ) out . ResultMetadata = metadata return out , nil }
Grants an AWS service or another account permission to use a function.
Grants an AWS service or another account permission to use a function .