Class Authorization
Authorization type for an API Destination Connection.
Inheritance
Namespace: Amazon.CDK.AWS.Events
Assembly: Amazon.CDK.AWS.Events.dll
Syntax (csharp)
public abstract class Authorization : DeputyBase
Syntax (vb)
Public MustInherit Class Authorization
Inherits DeputyBase
Remarks
ExampleMetadata: infused
Examples
var connection = new Connection(this, "Connection", new ConnectionProps {
Authorization = Authorization.ApiKey("x-api-key", SecretValue.SecretsManager("ApiSecretName")),
Description = "Connection with API Key x-api-key"
});
var destination = new ApiDestination(this, "Destination", new ApiDestinationProps {
Connection = connection,
Endpoint = "https://example.com",
Description = "Calling example.com with API key x-api-key"
});
var rule = new Rule(this, "Rule", new RuleProps {
Schedule = Schedule.Rate(Duration.Minutes(1)),
Targets = new [] { new ApiDestination(destination) }
});
Synopsis
Constructors
Authorization() | |
Authorization(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
Authorization(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Methods
ApiKey(String, SecretValue) | Use API key authorization. |
Basic(String, SecretValue) | Use username and password authorization. |
Oauth(IOAuthAuthorizationProps) | Use OAuth authorization. |
Constructors
Authorization()
protected Authorization()
Authorization(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected Authorization(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
Authorization(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected Authorization(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Methods
ApiKey(String, SecretValue)
Use API key authorization.
public static Authorization ApiKey(string apiKeyName, SecretValue apiKeyValue)
Parameters
- apiKeyName System.String
- apiKeyValue SecretValue
Returns
Remarks
API key authorization has two components: an API key name and an API key value. What these are depends on the target of your connection.
Basic(String, SecretValue)
Use username and password authorization.
public static Authorization Basic(string username, SecretValue password)
Parameters
- username System.String
- password SecretValue
Returns
Oauth(IOAuthAuthorizationProps)
Use OAuth authorization.
public static Authorization Oauth(IOAuthAuthorizationProps props)
Parameters
- props IOAuthAuthorizationProps
Returns