amazonka-cloudwatch-logs-1.6.0: Amazon CloudWatch Logs SDK.

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

Network.AWS.CloudWatchLogs.PutResourcePolicy

Contents

Description

Creates or updates a resource policy allowing other AWS services to put log events to this account, such as Amazon Route 53. An account can have up to 50 resource policies per region.

Synopsis

Creating a Request

putResourcePolicy :: PutResourcePolicy #

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

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

  • prpPolicyName - Name of the new policy. This parameter is required.
  • prpPolicyDocument - Details of the new policy, including the identity of the principal that is enabled to put logs to this account. This is formatted as a JSON string. The following example creates a resource policy enabling the Route 53 service to put DNS query logs in to the specified log group. Replace "logArn" with the ARN of your CloudWatch Logs resource, such as a log group or log stream. { Version: "2012-10-17" Statement: [ { Sid: Route53LogsToCloudWatchLogs, Effect: Allow, Principal: { Service: [ "route53.amazonaws.com" ] }, Action:"logs:PutLogEvents", Resource: logArn } ] }

data PutResourcePolicy #

See: putResourcePolicy smart constructor.

Instances

Eq PutResourcePolicy # 
Data PutResourcePolicy # 

Methods

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

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

toConstr :: PutResourcePolicy -> Constr #

dataTypeOf :: PutResourcePolicy -> DataType #

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

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

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

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

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

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

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

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

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

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

Read PutResourcePolicy # 
Show PutResourcePolicy # 
Generic PutResourcePolicy # 
Hashable PutResourcePolicy # 
ToJSON PutResourcePolicy # 
NFData PutResourcePolicy # 

Methods

rnf :: PutResourcePolicy -> () #

AWSRequest PutResourcePolicy # 
ToHeaders PutResourcePolicy # 
ToPath PutResourcePolicy # 
ToQuery PutResourcePolicy # 
type Rep PutResourcePolicy # 
type Rep PutResourcePolicy = D1 * (MetaData "PutResourcePolicy" "Network.AWS.CloudWatchLogs.PutResourcePolicy" "amazonka-cloudwatch-logs-1.6.0-HKcajwmKjdx6seMLJU2od6" False) (C1 * (MetaCons "PutResourcePolicy'" PrefixI True) ((:*:) * (S1 * (MetaSel (Just Symbol "_prpPolicyName") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * (Maybe Text))) (S1 * (MetaSel (Just Symbol "_prpPolicyDocument") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * (Maybe Text)))))
type Rs PutResourcePolicy # 

Request Lenses

prpPolicyName :: Lens' PutResourcePolicy (Maybe Text) #

Name of the new policy. This parameter is required.

prpPolicyDocument :: Lens' PutResourcePolicy (Maybe Text) #

Details of the new policy, including the identity of the principal that is enabled to put logs to this account. This is formatted as a JSON string. The following example creates a resource policy enabling the Route 53 service to put DNS query logs in to the specified log group. Replace "logArn" with the ARN of your CloudWatch Logs resource, such as a log group or log stream. { Version: "2012-10-17" Statement: [ { Sid: Route53LogsToCloudWatchLogs, Effect: Allow, Principal: { Service: [ "route53.amazonaws.com" ] }, Action:"logs:PutLogEvents", Resource: logArn } ] }

Destructuring the Response

putResourcePolicyResponse #

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

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

data PutResourcePolicyResponse #

See: putResourcePolicyResponse smart constructor.

Instances

Eq PutResourcePolicyResponse # 
Data PutResourcePolicyResponse # 

Methods

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

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

toConstr :: PutResourcePolicyResponse -> Constr #

dataTypeOf :: PutResourcePolicyResponse -> DataType #

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

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

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

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

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

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

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

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

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

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

Read PutResourcePolicyResponse # 
Show PutResourcePolicyResponse # 
Generic PutResourcePolicyResponse # 
NFData PutResourcePolicyResponse # 
type Rep PutResourcePolicyResponse # 
type Rep PutResourcePolicyResponse = D1 * (MetaData "PutResourcePolicyResponse" "Network.AWS.CloudWatchLogs.PutResourcePolicy" "amazonka-cloudwatch-logs-1.6.0-HKcajwmKjdx6seMLJU2od6" False) (C1 * (MetaCons "PutResourcePolicyResponse'" PrefixI True) ((:*:) * (S1 * (MetaSel (Just Symbol "_prprsResourcePolicy") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * (Maybe ResourcePolicy))) (S1 * (MetaSel (Just Symbol "_prprsResponseStatus") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * Int))))

Response Lenses

prprsResponseStatus :: Lens' PutResourcePolicyResponse Int #

  • - | The response status code.