Class CfnAPIKey.ApiKeyRestrictionsProperty
API Restrictions on the allowed actions, resources, and referers for an API key resource.
Inheritance
Implements
Namespace: Amazon.CDK.AWS.Location
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class ApiKeyRestrictionsProperty : Object, CfnAPIKey.IApiKeyRestrictionsProperty
Syntax (vb)
Public Class ApiKeyRestrictionsProperty
Inherits Object
Implements CfnAPIKey.IApiKeyRestrictionsProperty
Remarks
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Location;
var apiKeyRestrictionsProperty = new ApiKeyRestrictionsProperty {
AllowActions = new [] { "allowActions" },
AllowResources = new [] { "allowResources" },
// the properties below are optional
AllowReferers = new [] { "allowReferers" }
};
Synopsis
Constructors
ApiKeyRestrictionsProperty() |
Properties
AllowActions | A list of allowed actions that an API key resource grants permissions to perform. |
AllowReferers | An optional list of allowed HTTP referers for which requests must originate from. |
AllowResources | A list of allowed resource ARNs that a API key bearer can perform actions on. |
Constructors
ApiKeyRestrictionsProperty()
public ApiKeyRestrictionsProperty()
Properties
AllowActions
A list of allowed actions that an API key resource grants permissions to perform.
public string[] AllowActions { get; set; }
Property Value
System.String[]
Remarks
You must have at least one action for each type of resource. For example, if you have a place resource, you must include at least one place action.
The following are valid values for the actions.
You must use these strings exactly. For example, to provide access to map rendering, the only valid action is <code>geo:GetMap*</code> as an input to the list. <code>["geo:GetMap*"]</code> is valid but <code>["geo:GetMapTile"]</code> is not. Similarly, you cannot use <code>["geo:SearchPlaceIndexFor*"]</code> - you must list each of the Place actions separately.
AllowReferers
An optional list of allowed HTTP referers for which requests must originate from.
public string[] AllowReferers { get; set; }
Property Value
System.String[]
Remarks
Requests using this API key from other domains will not be allowed.
Requirements:
Question mark (?) will replace any single character (including hexadecimal digits).
Asterisk (*) will replace any multiple characters (including multiple hexadecimal digits).
AllowResources
A list of allowed resource ARNs that a API key bearer can perform actions on.
public string[] AllowResources { get; set; }
Property Value
System.String[]
Remarks
For more information about ARN format, see Amazon Resource Names (ARNs) .