class Tracker (construct)
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.Location.Alpha.Tracker |
Go | github.com/aws/aws-cdk-go/awscdklocationalpha/v2#Tracker |
Java | software.amazon.awscdk.services.location.alpha.Tracker |
Python | aws_cdk.aws_location_alpha.Tracker |
TypeScript (source) | @aws-cdk/aws-location-alpha ยป Tracker |
Implements
IConstruct
, IDependable
, IResource
, ITracker
A Tracker.
Example
declare const role: iam.Role;
const tracker = new location.Tracker(this, 'Tracker', {
trackerName: 'MyTracker',
});
tracker.grantRead(role);
Initializer
new Tracker(scope: Construct, id: string, props?: TrackerProps)
Parameters
- scope
Construct
- id
string
- props
Tracker
Props
Construct Props
Name | Type | Description |
---|---|---|
description? | string | A description for the tracker. |
event | boolean | Send filtered device position updates to default EventBridge bus. |
geofence | IGeofence [] | An optional list of geofence collections to associate with the tracker resource. |
kms | IKey | The customer managed key to encrypt data. |
kms | boolean | Whether to opt-in to the Bounding Polygon Queries feature with customer managed key. |
position | Position | The position filtering for the tracker resource. |
tracker | string | A name for the tracker. |
description?
Type:
string
(optional, default: no description)
A description for the tracker.
eventBridgeEnabled?
Type:
boolean
(optional, default: false)
Send filtered device position updates to default EventBridge bus.
geofenceCollections?
Type:
IGeofence
[]
(optional, default: no geofence collections are associated)
An optional list of geofence collections to associate with the tracker resource.
kmsKey?
Type:
IKey
(optional, default: Use an AWS managed key)
The customer managed key to encrypt data.
If you set customer managed key, the Bounding Polygon Queries feature will be disabled by default. You can choose to opt-in to the Bounding Polygon Queries feature by setting the kmsKeyEnableGeospatialQueries parameter to true.
kmsKeyEnableGeospatialQueries?
Type:
boolean
(optional, default: false)
Whether to opt-in to the Bounding Polygon Queries feature with customer managed key.
positionFiltering?
Type:
Position
(optional, default: PositionFiltering.TIME_BASED)
The position filtering for the tracker resource.
trackerName?
Type:
string
(optional, default: A name is automatically generated)
A name for the tracker.
Must be between 1 and 100 characters and contain only alphanumeric characters, hyphens, periods and underscores.
Properties
Name | Type | Description |
---|---|---|
env | Resource | The environment this resource belongs to. |
node | Node | The tree node. |
stack | Stack | The stack in which this resource is defined. |
tracker | string | The Amazon Resource Name (ARN) of the tracker resource. |
tracker | string | The timestamp for when the tracker resource was created in ISO 8601 format. |
tracker | string | The name of the tracker. |
tracker | string | The timestamp for when the tracker resource was last updated in ISO 8601 format. |
env
Type:
Resource
The environment this resource belongs to.
For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.
node
Type:
Node
The tree node.
stack
Type:
Stack
The stack in which this resource is defined.
trackerArn
Type:
string
The Amazon Resource Name (ARN) of the tracker resource.
trackerCreateTime
Type:
string
The timestamp for when the tracker resource was created in ISO 8601 format.
trackerName
Type:
string
The name of the tracker.
trackerUpdateTime
Type:
string
The timestamp for when the tracker resource was last updated in ISO 8601 format.
Methods
Name | Description |
---|---|
add | Add Geofence Collections which are associated to the tracker resource. |
apply | Apply the given removal policy to this resource. |
grant(grantee, ...actions) | Grant the given principal identity permissions to perform the actions on this tracker. |
grant | Grant the given identity permissions to read device positions from a tracker. |
grant | Grant the given identity permissions to update device positions for a tracker. |
to | Returns a string representation of this construct. |
static from | Use an existing tracker by ARN. |
static from | Use an existing tracker by name. |
GeofenceCollections(...geofenceCollections)
addpublic addGeofenceCollections(...geofenceCollections: IGeofenceCollection[]): void
Parameters
- geofenceCollections
IGeofence
Collection
Add Geofence Collections which are associated to the tracker resource.
RemovalPolicy(policy)
applypublic applyRemovalPolicy(policy: RemovalPolicy): void
Parameters
- policy
Removal
Policy
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.
The resource can be deleted (RemovalPolicy.DESTROY
), or left in your AWS
account for data recovery and cleanup later (RemovalPolicy.RETAIN
).
grant(grantee, ...actions)
public grant(grantee: IGrantable, ...actions: string[]): Grant
Parameters
- grantee
IGrantable
- actions
string
Returns
Grant the given principal identity permissions to perform the actions on this tracker.
Read(grantee)
grantpublic grantRead(grantee: IGrantable): Grant
Parameters
- grantee
IGrantable
Returns
Grant the given identity permissions to read device positions from a tracker.
UpdateDevicePositions(grantee)
grantpublic grantUpdateDevicePositions(grantee: IGrantable): Grant
Parameters
- grantee
IGrantable
Returns
Grant the given identity permissions to update device positions for a tracker.
String()
topublic toString(): string
Returns
string
Returns a string representation of this construct.
TrackerArn(scope, id, trackerArn)
static frompublic static fromTrackerArn(scope: Construct, id: string, trackerArn: string): ITracker
Parameters
- scope
Construct
- id
string
- trackerArn
string
Returns
Use an existing tracker by ARN.
TrackerName(scope, id, trackerName)
static frompublic static fromTrackerName(scope: Construct, id: string, trackerName: string): ITracker
Parameters
- scope
Construct
- id
string
- trackerName
string
Returns
Use an existing tracker by name.