This documentation is for the developer preview release of the AWS CDK. Do not use this version of the AWS CDK in production. Subsequent releases of the AWS CDK will likely include breaking changes.

@aws-cdk/alexa-ask

Alexa Ask Construct Library

const alexaAsk = require('@aws-cdk/alexa-ask');

Alexa as deploy target for CodePipeline

You can deploy to Alexa using CodePipeline with the following DeployAction.

// Read the secrets from ParameterStore
const clientId = new cdk.SecretParameter(this, 'AlexaClientId', { ssmParameter: '/Alexa/ClientId' });
const clientSecret = new cdk.SecretParameter(this, 'AlexaClientSecret', { ssmParameter: '/Alexa/ClientSecret' });
const refreshToken = new cdk.SecretParameter(this, 'AlexaRefreshToken', { ssmParameter: '/Alexa/RefreshToken' });

// Add deploy action
new alexaAsk.AlexaSkillDeployAction({
  actionName: 'DeploySkill',
  runOrder: 1,
  inputArtifact: sourceAction.outputArtifact,
  clientId: clientId.value,
  clientSecret: clientSecret.value,
  refreshToken: refreshToken.value,
  skillId: 'amzn1.ask.skill.12345678-1234-1234-1234-123456789012',
});

If you need manifest overrides you can specify them as parameterOverridesArtifact in the action:

const cloudformation = require('@aws-cdk/aws-cloudformation');

// Deploy some CFN change set and store output
const executeChangeSetAction = new cloudformation.PipelineExecuteChangeSetAction({
  actionName: 'ExecuteChangesTest',
  runOrder: 2,
  stackName,
  changeSetName,
  outputFileName: 'overrides.json',
  outputArtifactName: 'CloudFormation',
});

// Provide CFN output as manifest overrides
new alexaAsk.AlexaSkillDeployAction({
  actionName: 'DeploySkill',
  runOrder: 1,
  inputArtifact: sourceAction.outputArtifact,
  parameterOverridesArtifact: executeChangeSetAction.outputArtifact,
  clientId: clientId.value,
  clientSecret: clientSecret.value,
  refreshToken: refreshToken.value,
  skillId: 'amzn1.ask.skill.12345678-1234-1234-1234-123456789012',
});

Reference

View in Nuget

csproj:

<PackageReference Include="Amazon.CDK.Alexa.Ask" Version="0.25.3" />

dotnet:

dotnet add package Amazon.CDK.Alexa.Ask --version 0.25.3

packages.config:

<package id="Amazon.CDK.Alexa.Ask" version="0.25.3" />

View in Maven Central

Apache Buildr:

'software.amazon.awscdk:alexa-ask:jar:0.25.3'

Apache Ivy:

<dependency groupId="software.amazon.awscdk" name="alexa-ask" rev="0.25.3"/>

Apache Maven:

<dependency>
  <groupId>software.amazon.awscdk</groupId>
  <artifactId>alexa-ask</artifactId>
  <version>0.25.3</version>
</dependency>

Gradle / Grails:

compile 'software.amazon.awscdk:alexa-ask:0.25.3'

Groovy Grape:

@Grapes(
@Grab(group='software.amazon.awscdk', module='alexa-ask', version='0.25.3')
)

View in NPM

npm:

$ npm i @aws-cdk/alexa-ask@0.25.3

package.json:

{
  "@aws-cdk/alexa-ask": "^0.25.3"
}

yarn:

$ yarn add @aws-cdk/alexa-ask@0.25.3

View in NPM

npm:

$ npm i @aws-cdk/alexa-ask@0.25.3

package.json:

{
  "@aws-cdk/alexa-ask": "^0.25.3"
}

yarn:

$ yarn add @aws-cdk/alexa-ask@0.25.3

AlexaSkillDeployAction

class @aws-cdk/alexa-ask.AlexaSkillDeployAction(props)

Language-specific names:

using Amazon.CDK.Alexa.Ask;
import software.amazon.awscdk.alexa.ask.AlexaSkillDeployAction;
const { AlexaSkillDeployAction } = require('@aws-cdk/alexa-ask');
import { AlexaSkillDeployAction } from '@aws-cdk/alexa-ask';

Deploys the skill to Alexa

Extends:@aws-cdk/aws-codepipeline-api.DeployAction
Parameters:props (AlexaSkillDeployActionProps) –
bind(_stage, _scope)

Implements @aws-cdk/aws-codepipeline-api.Action.bind()

The method called when an Action is attached to a Pipeline.

This method is guaranteed to be called only once for each Action instance.

Protected method

Parameters:
addInputArtifact(artifact) → @aws-cdk/aws-codepipeline-api.Action

Inherited from @aws-cdk/aws-codepipeline-api.Action

Protected method

Parameters:artifact (@aws-cdk/aws-codepipeline-api.Artifact) –
Return type:@aws-cdk/aws-codepipeline-api.Action
addOutputArtifact(name) → @aws-cdk/aws-codepipeline-api.Artifact

Inherited from @aws-cdk/aws-codepipeline-api.Action

Protected method

Parameters:name (string) –
Return type:@aws-cdk/aws-codepipeline-api.Artifact
onStateChange(name[, target[, options]]) → @aws-cdk/aws-events.EventRule

Inherited from @aws-cdk/aws-codepipeline-api.Action

Parameters:
Return type:

@aws-cdk/aws-events.EventRule

validate() → string[]

Inherited from @aws-cdk/aws-codepipeline-api.Action

Protected method

Return type:string[]
actionName

Inherited from @aws-cdk/aws-codepipeline-api.Action

Type:string (readonly)
category

Inherited from @aws-cdk/aws-codepipeline-api.Action

The category of the action.

The category defines which action type the owner

(the entity that performs the action) performs.

Type:@aws-cdk/aws-codepipeline-api.ActionCategory (readonly)
owner

Inherited from @aws-cdk/aws-codepipeline-api.Action

Type:string (readonly)
provider

Inherited from @aws-cdk/aws-codepipeline-api.Action

The service provider that the action calls.

Type:string (readonly)
runOrder

Inherited from @aws-cdk/aws-codepipeline-api.Action

The order in which AWS CodePipeline runs this action.

For more information, see the AWS CodePipeline User Guide.

https://docs.aws.amazon.com/codepipeline/latest/userguide/reference-pipeline-structure.html#action-requirements

Type:number (readonly)
scope

Inherited from @aws-cdk/aws-codepipeline-api.Action

Retrieves the Construct scope of this Action.

Only available after the Action has been added to a Stage,

and that Stage to a Pipeline.

Protected property

Type:@aws-cdk/cdk.Construct (readonly)
version

Inherited from @aws-cdk/aws-codepipeline-api.Action

Type:string (readonly)
configuration

Inherited from @aws-cdk/aws-codepipeline-api.Action

The action’s configuration. These are key-value pairs that specify input values for an action.

For more information, see the AWS CodePipeline User Guide.

http://docs.aws.amazon.com/codepipeline/latest/userguide/reference-pipeline-structure.html#action-requirements

Type:any (optional) (readonly)
region

Inherited from @aws-cdk/aws-codepipeline-api.Action

The AWS region the given Action resides in.

Note that a cross-region Pipeline requires replication buckets to function correctly.

You can provide their names with the {@link PipelineProps#crossRegionReplicationBuckets} property.

If you don’t, the CodePipeline Construct will create new Stacks in your CDK app containing those buckets,

that you will need to cdk deploy before deploying the main, Pipeline-containing Stack.

Type:string (optional) (readonly)
Default:the Action resides in the same region as the Pipeline
role

Inherited from @aws-cdk/aws-codepipeline-api.Action

The service role that is assumed during execution of action.

This role is not mandatory, however more advanced configuration

may require specifying it.

Type:@aws-cdk/aws-iam.IRole (optional) (readonly)

AlexaSkillDeployActionProps (interface)

class @aws-cdk/alexa-ask.AlexaSkillDeployActionProps

Language-specific names:

using Amazon.CDK.Alexa.Ask;
import software.amazon.awscdk.alexa.ask.AlexaSkillDeployActionProps;
// AlexaSkillDeployActionProps is an interface
import { AlexaSkillDeployActionProps } from '@aws-cdk/alexa-ask';

Construction properties of the {@link AlexaSkillDeployAction Alexa deploy Action}.

Extends:@aws-cdk/aws-codepipeline-api.CommonActionProps
clientId

The client id of the developer console token

Type:@aws-cdk/cdk.Secret
clientSecret

The client secret of the developer console token

Type:@aws-cdk/cdk.Secret
inputArtifact

The source artifact containing the voice model and skill manifest

Type:@aws-cdk/aws-codepipeline-api.Artifact
refreshToken

The refresh token of the developer console token

Type:@aws-cdk/cdk.Secret
skillId

The Alexa skill id

Type:string
parameterOverridesArtifact

An optional artifact containing overrides for the skill manifest

Type:@aws-cdk/aws-codepipeline-api.Artifact (optional)
actionName

Inherited from @aws-cdk/aws-codepipeline-api.CommonActionProps

The physical, human-readable name of the Action.

Not that Action names must be unique within a single Stage.

Type:string
runOrder

Inherited from @aws-cdk/aws-codepipeline-api.CommonActionProps

The runOrder property for this Action.

RunOrder determines the relative order in which multiple Actions in the same Stage execute.

Type:number (optional)
Default:1

CfnSkill

class @aws-cdk/alexa-ask.CfnSkill(scope, id, props)

Language-specific names:

using Amazon.CDK.Alexa.Ask;
import software.amazon.awscdk.alexa.ask.CfnSkill;
const { CfnSkill } = require('@aws-cdk/alexa-ask');
import { CfnSkill } from '@aws-cdk/alexa-ask';
Extends:

@aws-cdk/cdk.Resource

Parameters:
renderProperties(properties) → string => any

Overrides @aws-cdk/cdk.Resource.renderProperties()

Protected method

Parameters:properties (any) –
Return type:string => any
resourceTypeName

The CloudFormation resource type name for this resource class.

Type:string (readonly) (static)
propertyOverrides
Type:CfnSkillProps (readonly)
skillId
Type:string (readonly)
class AuthenticationConfigurationProperty

Language-specific names:

using Amazon.CDK.Alexa.Ask;
import software.amazon.awscdk.alexa.ask.CfnSkill.AuthenticationConfigurationProperty;
// CfnSkill.AuthenticationConfigurationProperty is an interface
import { CfnSkill.AuthenticationConfigurationProperty } from '@aws-cdk/alexa-ask';
clientId

CfnSkill.AuthenticationConfigurationProperty.ClientId

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ask-skill-authenticationconfiguration.html#cfn-ask-skill-authenticationconfiguration-clientid

Type:string
clientSecret

CfnSkill.AuthenticationConfigurationProperty.ClientSecret

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ask-skill-authenticationconfiguration.html#cfn-ask-skill-authenticationconfiguration-clientsecret

Type:string
refreshToken

CfnSkill.AuthenticationConfigurationProperty.RefreshToken

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ask-skill-authenticationconfiguration.html#cfn-ask-skill-authenticationconfiguration-refreshtoken

Type:string
class OverridesProperty

Language-specific names:

using Amazon.CDK.Alexa.Ask;
import software.amazon.awscdk.alexa.ask.CfnSkill.OverridesProperty;
// CfnSkill.OverridesProperty is an interface
import { CfnSkill.OverridesProperty } from '@aws-cdk/alexa-ask';
manifest

CfnSkill.OverridesProperty.Manifest

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ask-skill-overrides.html#cfn-ask-skill-overrides-manifest

Type:json or @aws-cdk/cdk.Token (optional)
class SkillPackageProperty

Language-specific names:

using Amazon.CDK.Alexa.Ask;
import software.amazon.awscdk.alexa.ask.CfnSkill.SkillPackageProperty;
// CfnSkill.SkillPackageProperty is an interface
import { CfnSkill.SkillPackageProperty } from '@aws-cdk/alexa-ask';
s3Bucket

CfnSkill.SkillPackageProperty.S3Bucket

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ask-skill-skillpackage.html#cfn-ask-skill-skillpackage-s3bucket

Type:string
s3Key

CfnSkill.SkillPackageProperty.S3Key

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ask-skill-skillpackage.html#cfn-ask-skill-skillpackage-s3key

Type:string
overrides

CfnSkill.SkillPackageProperty.Overrides

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ask-skill-skillpackage.html#cfn-ask-skill-skillpackage-overrides

Type:@aws-cdk/cdk.Token or OverridesProperty (optional)
s3BucketRole

CfnSkill.SkillPackageProperty.S3BucketRole

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ask-skill-skillpackage.html#cfn-ask-skill-skillpackage-s3bucketrole

Type:string (optional)
s3ObjectVersion

CfnSkill.SkillPackageProperty.S3ObjectVersion

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ask-skill-skillpackage.html#cfn-ask-skill-skillpackage-s3objectversion

Type:string (optional)
toString() → string

Inherited from @aws-cdk/cdk.Construct

Returns a string representation of this construct.

Return type:string
validate() → string[]

Inherited from @aws-cdk/cdk.Construct

Validate the current construct.

This method can be implemented by derived constructs in order to perform

validation logic. It is called on all constructs before synthesis.

Protected method

Returns:An array of validation error messages, or an empty array if there the construct is valid.
Return type:string[]
dependencyRoots

Inherited from @aws-cdk/cdk.Construct

The set of constructs that form the root of this dependable

All resources under all returned constructs are included in the ordering

dependency.

Type:@aws-cdk/cdk.IConstruct[] (readonly)
node

Inherited from @aws-cdk/cdk.Construct

Construct node.

Type:@aws-cdk/cdk.ConstructNode (readonly)
ref

Inherited from @aws-cdk/cdk.Referenceable

Returns a token to a CloudFormation { Ref } that references this entity based on it’s logical ID.

Type:string (readonly)
addDeletionOverride(path)

Inherited from @aws-cdk/cdk.Resource

Syntactic sugar for addOverride(path, undefined).

Parameters:path (string) – The path of the value to delete
addDependsOn(resource)

Inherited from @aws-cdk/cdk.Resource

Indicates that this resource depends on another resource and cannot be provisioned

unless the other resource has been successfully provisioned.

Parameters:resource (@aws-cdk/cdk.Resource) –
addOverride(path, value)

Inherited from @aws-cdk/cdk.Resource

Adds an override to the synthesized CloudFormation resource. To add a

property override, either use addPropertyOverride or prefix path with

“Properties.” (i.e. Properties.TopicName).

Parameters:
  • path (string) – The path of the property, you can use dot notation to override values in complex types. Any intermdediate keys will be created as needed.
  • value (any) – The value. Could be primitive or complex.
addPropertyDeletionOverride(propertyPath)

Inherited from @aws-cdk/cdk.Resource

Adds an override that deletes the value of a property from the resource definition.

Parameters:propertyPath (string) – The path to the property.
addPropertyOverride(propertyPath, value)

Inherited from @aws-cdk/cdk.Resource

Adds an override to a resource property.

Syntactic sugar for addOverride(“Properties.<…>”, value).

Parameters:
  • propertyPath (string) – The path of the property
  • value (any) – The value
getAtt(attributeName) → @aws-cdk/cdk.CfnReference

Inherited from @aws-cdk/cdk.Resource

Returns a token for an runtime attribute of this resource.

Ideally, use generated attribute accessors (e.g. resource.arn), but this can be used for future compatibility

in case there is no generated attribute.

Parameters:attributeName (string) – The name of the attribute.
Return type:@aws-cdk/cdk.CfnReference
toCloudFormation() → json

Inherited from @aws-cdk/cdk.Resource

Emits CloudFormation for this resource.

Return type:json
options

Inherited from @aws-cdk/cdk.Resource

Options for this resource, such as condition, update policy etc.

Type:@aws-cdk/cdk.ResourceOptions (readonly)
properties

Inherited from @aws-cdk/cdk.Resource

AWS resource properties.

This object is rendered via a call to “renderProperties(this.properties)”.

Protected property

Type:any (readonly)
resourceType

Inherited from @aws-cdk/cdk.Resource

AWS resource type.

Type:string (readonly)
untypedPropertyOverrides

Inherited from @aws-cdk/cdk.Resource

AWS resource property overrides.

During synthesis, the method “renderProperties(this.overrides)” is called

with this object, and merged on top of the output of

“renderProperties(this.properties)”.

Derived classes should expose a strongly-typed version of this object as

a public property called propertyOverrides.

Protected property

Type:any (readonly)
overrideLogicalId(newLogicalId)

Inherited from @aws-cdk/cdk.StackElement

Overrides the auto-generated logical ID with a specific ID.

Parameters:newLogicalId (string) – The new logical ID to use for this stack element.
prepare()

Inherited from @aws-cdk/cdk.StackElement

Automatically detect references in this StackElement

Protected method

creationStackTrace

Inherited from @aws-cdk/cdk.StackElement

Type:string[] (readonly)
logicalId

Inherited from @aws-cdk/cdk.StackElement

The logical ID for this CloudFormation stack element. The logical ID of the element

is calculated from the path of the resource node in the construct tree.

To override this value, use overrideLogicalId(newLogicalId).

Type:string (readonly)
stackPath

Inherited from @aws-cdk/cdk.StackElement

Return the path with respect to the stack

Type:string (readonly)

CfnSkillProps (interface)

class @aws-cdk/alexa-ask.CfnSkillProps

Language-specific names:

using Amazon.CDK.Alexa.Ask;
import software.amazon.awscdk.alexa.ask.CfnSkillProps;
// CfnSkillProps is an interface
import { CfnSkillProps } from '@aws-cdk/alexa-ask';
authenticationConfiguration

Alexa::ASK::Skill.AuthenticationConfiguration

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ask-skill.html#cfn-ask-skill-authenticationconfiguration

Type:AuthenticationConfigurationProperty or @aws-cdk/cdk.Token
skillPackage

Alexa::ASK::Skill.SkillPackage

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ask-skill.html#cfn-ask-skill-skillpackage

Type:@aws-cdk/cdk.Token or SkillPackageProperty
vendorId

Alexa::ASK::Skill.VendorId

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ask-skill.html#cfn-ask-skill-vendorid

Type:string