amazonka-lambda-1.4.5: Amazon Lambda SDK.

Copyright(c) 2013-2016 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay@gmail.com>
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellNone
LanguageHaskell2010

Network.AWS.Lambda.GetPolicy

Contents

Description

Returns the resource policy associated with the specified Lambda function.

If you are using the versioning feature, you can get the resource policy associated with the specific Lambda function version or alias by specifying the version or alias name using the Qualifier parameter. For more information about versioning, see AWS Lambda Function Versioning and Aliases .

For information about adding permissions, see AddPermission .

You need permission for the lambda:GetPolicy action.

Synopsis

Creating a Request

getPolicy #

Creates a value of GetPolicy with the minimum fields required to make a request.

Use one of the following lenses to modify other fields as desired:

  • gpQualifier - You can specify this optional query parameter to specify a function version or an alias name in which case this API will return all permissions associated with the specific qualified ARN. If you don't provide this parameter, the API will return permissions that apply to the unqualified function ARN.
  • gpFunctionName - Function name whose resource policy you want to retrieve. You can specify the 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 ). If you are using versioning, you can also provide a qualified function ARN (ARN that is qualified with function version or alias name as suffix). AWS Lambda also allows you to specify only the function name with 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.

data GetPolicy #

See: getPolicy smart constructor.

Instances

Eq GetPolicy # 
Data GetPolicy # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> GetPolicy -> c GetPolicy #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c GetPolicy #

toConstr :: GetPolicy -> Constr #

dataTypeOf :: GetPolicy -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c GetPolicy) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c GetPolicy) #

gmapT :: (forall b. Data b => b -> b) -> GetPolicy -> GetPolicy #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> GetPolicy -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> GetPolicy -> r #

gmapQ :: (forall d. Data d => d -> u) -> GetPolicy -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> GetPolicy -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> GetPolicy -> m GetPolicy #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> GetPolicy -> m GetPolicy #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> GetPolicy -> m GetPolicy #

Read GetPolicy # 
Show GetPolicy # 
Generic GetPolicy # 

Associated Types

type Rep GetPolicy :: * -> * #

Hashable GetPolicy # 
NFData GetPolicy # 

Methods

rnf :: GetPolicy -> () #

AWSRequest GetPolicy # 
ToQuery GetPolicy # 
ToPath GetPolicy # 
ToHeaders GetPolicy # 

Methods

toHeaders :: GetPolicy -> [Header] #

type Rep GetPolicy # 
type Rep GetPolicy = D1 (MetaData "GetPolicy" "Network.AWS.Lambda.GetPolicy" "amazonka-lambda-1.4.5-HBw5BdgXNtO3bSf0cOyCBw" False) (C1 (MetaCons "GetPolicy'" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "_gpQualifier") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text))) (S1 (MetaSel (Just Symbol "_gpFunctionName") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text))))
type Rs GetPolicy # 

Request Lenses

gpQualifier :: Lens' GetPolicy (Maybe Text) #

You can specify this optional query parameter to specify a function version or an alias name in which case this API will return all permissions associated with the specific qualified ARN. If you don't provide this parameter, the API will return permissions that apply to the unqualified function ARN.

gpFunctionName :: Lens' GetPolicy Text #

Function name whose resource policy you want to retrieve. You can specify the 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 ). If you are using versioning, you can also provide a qualified function ARN (ARN that is qualified with function version or alias name as suffix). AWS Lambda also allows you to specify only the function name with 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.

Destructuring the Response

getPolicyResponse #

Creates a value of GetPolicyResponse with the minimum fields required to make a request.

Use one of the following lenses to modify other fields as desired:

  • gprsPolicy - The resource policy associated with the specified function. The response returns the same as a string using a backslash ("") as an escape character in the JSON.
  • gprsResponseStatus - -- | The response status code.

data GetPolicyResponse #

See: getPolicyResponse smart constructor.

Instances

Eq GetPolicyResponse # 
Data GetPolicyResponse # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> GetPolicyResponse -> c GetPolicyResponse #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c GetPolicyResponse #

toConstr :: GetPolicyResponse -> Constr #

dataTypeOf :: GetPolicyResponse -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c GetPolicyResponse) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c GetPolicyResponse) #

gmapT :: (forall b. Data b => b -> b) -> GetPolicyResponse -> GetPolicyResponse #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> GetPolicyResponse -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> GetPolicyResponse -> r #

gmapQ :: (forall d. Data d => d -> u) -> GetPolicyResponse -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> GetPolicyResponse -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> GetPolicyResponse -> m GetPolicyResponse #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> GetPolicyResponse -> m GetPolicyResponse #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> GetPolicyResponse -> m GetPolicyResponse #

Read GetPolicyResponse # 
Show GetPolicyResponse # 
Generic GetPolicyResponse # 
NFData GetPolicyResponse # 

Methods

rnf :: GetPolicyResponse -> () #

type Rep GetPolicyResponse # 
type Rep GetPolicyResponse = D1 (MetaData "GetPolicyResponse" "Network.AWS.Lambda.GetPolicy" "amazonka-lambda-1.4.5-HBw5BdgXNtO3bSf0cOyCBw" False) (C1 (MetaCons "GetPolicyResponse'" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "_gprsPolicy") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text))) (S1 (MetaSel (Just Symbol "_gprsResponseStatus") NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Int))))

Response Lenses

gprsPolicy :: Lens' GetPolicyResponse (Maybe Text) #

The resource policy associated with the specified function. The response returns the same as a string using a backslash ("") as an escape character in the JSON.

gprsResponseStatus :: Lens' GetPolicyResponse Int #

  • - | The response status code.