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

Copyright(c) 2013-2017 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 Source #

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 Source #

See: putResourcePolicy smart constructor.

Instances

Eq PutResourcePolicy Source # 
Data PutResourcePolicy Source # 

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 Source # 
Show PutResourcePolicy Source # 
Generic PutResourcePolicy Source # 
Hashable PutResourcePolicy Source # 
ToJSON PutResourcePolicy Source # 
NFData PutResourcePolicy Source # 

Methods

rnf :: PutResourcePolicy -> () #

AWSRequest PutResourcePolicy Source # 
ToQuery PutResourcePolicy Source # 
ToPath PutResourcePolicy Source # 
ToHeaders PutResourcePolicy Source # 
type Rep PutResourcePolicy Source # 
type Rep PutResourcePolicy = D1 (MetaData "PutResourcePolicy" "Network.AWS.CloudWatchLogs.PutResourcePolicy" "amazonka-cloudwatch-logs-1.5.0-3vuxaAoYUATHD7OLMfoSU1" 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 Source # 

Request Lenses

prpPolicyName :: Lens' PutResourcePolicy (Maybe Text) Source #

Name of the new policy. This parameter is required.

prpPolicyDocument :: Lens' PutResourcePolicy (Maybe Text) Source #

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 Source #

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 Source #

See: putResourcePolicyResponse smart constructor.

Instances

Eq PutResourcePolicyResponse Source # 
Data PutResourcePolicyResponse Source # 

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 Source # 
Show PutResourcePolicyResponse Source # 
Generic PutResourcePolicyResponse Source # 
NFData PutResourcePolicyResponse Source # 
type Rep PutResourcePolicyResponse Source # 
type Rep PutResourcePolicyResponse = D1 (MetaData "PutResourcePolicyResponse" "Network.AWS.CloudWatchLogs.PutResourcePolicy" "amazonka-cloudwatch-logs-1.5.0-3vuxaAoYUATHD7OLMfoSU1" 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