Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

location: eventBridgeEnabled not working with CfnTracker #29276

Open
solegaonkar opened this issue Feb 27, 2024 · 2 comments
Open

location: eventBridgeEnabled not working with CfnTracker #29276

solegaonkar opened this issue Feb 27, 2024 · 2 comments
Labels
@aws-cdk/aws-location-alpha Related to the @aws-cdk/aws-location-alpha package bug This issue is a bug. p3

Comments

@solegaonkar
Copy link

Describe the bug

The EventBridgeEnabled property in the Location Tracker is not present in the CfnTrackerProps. Even if I add it forcefully with an @ts-ignore, it does not reflect in the generated CloudFormation stack.

After struggling hard, I had to set it manually. Can you please fix this?

Expected Behavior

CfnTrackerProps should have a property eventBridgeEnabled, and it should map to the EventBridgeEnabled in the Location Tracker resource of the CloudFormation template

Current Behavior

The field is missing in the data type, and not mapped to the CloudFormation stack

Reproduction Steps

const cfnTracker = new location.CfnTracker(this, "MyCfnTracker", { trackerName: "AssetTracker", description: "description", positionFiltering: "AccuracyBased", eventBridgeEnabled: true, });

Possible Solution

The CfnTrackerProps Type should be updated to include this field, and it should be appropriately mapped to the generated CloudFormation template

Additional Information/Context

No response

CDK CLI Version

2.130.0

Framework Version

No response

Node.js Version

18.16.0

OS

Windows

Language

TypeScript

Language Version

No response

Other information

No response

@solegaonkar solegaonkar added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Feb 27, 2024
@github-actions github-actions bot added the aws-cdk-lib Related to the aws-cdk-lib package label Feb 27, 2024
@pahud pahud changed the title (module name): (short issue description) aws-cdk-lib.aws_location.CfnTracker: eventBridgeEnabled not working location: eventBridgeEnabled not working with CfnTracker Feb 27, 2024
@github-actions github-actions bot added the @aws-cdk/aws-cloudformation Related to AWS CloudFormation label Feb 27, 2024
@pahud
Copy link
Contributor

pahud commented Feb 27, 2024

Yes it does exist in the CFN document and CFN spec 162.0.0.

And it does exist in 2.130.0 api reference.

I didn't see any error from my IDE

image

The field is missing in the data type, and not mapped to the CloudFormation stack

What made you believe it was missing in the data type and not mapped?

@pahud pahud added p2 response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed needs-triage This issue or PR still needs to be triaged. labels Feb 27, 2024
@solegaonkar
Copy link
Author

That is strange! This is what I see..

image

The location was imported as...

import { aws_location as location } from "aws-cdk-lib";

When I tried Ctrl+Click on the CfnTracker, then CfnTrackerProps to see its code, this is what I see

export interface CfnTrackerProps {
    /**
     * An optional description for the tracker resource.
     *
     * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-location-tracker.html#cfn-location-tracker-description
     */
    readonly description?: string;
    /**
     * A key identifier for an [AWS KMS customer managed key](https://docs.aws.amazon.com/kms/latest/developerguide/create-keys.html) . Enter a key ID, key ARN, alias name, or alias ARN.
     *
     * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-location-tracker.html#cfn-location-tracker-kmskeyid
     */
    readonly kmsKeyId?: string;
    /**
     * Specifies the position filtering for the tracker resource.
     *
     * Valid values:
     *
     * - `TimeBased` - Location updates are evaluated against linked geofence collections, but not every location update is stored. If your update frequency is more often than 30 seconds, only one update per 30 seconds is stored for each unique device ID.
     * - `DistanceBased` - If the device has moved less than 30 m (98.4 ft), location updates are ignored. Location updates within this area are neither evaluated against linked geofence collections, nor stored. This helps control costs by reducing the number of geofence evaluations and historical device positions to paginate through. Distance-based filtering can also reduce the effects of GPS noise when displaying device trajectories on a map.
     * - `AccuracyBased` - If the device has moved less than the measured accuracy, location updates are ignored. For example, if two consecutive updates from a device have a horizontal accuracy of 5 m and 10 m, the second update is ignored if the device has moved less than 15 m. Ignored location updates are neither evaluated against linked geofence collections, nor stored. This can reduce the effects of GPS noise when displaying device trajectories on a map, and can help control your costs by reducing the number of geofence evaluations.
     *
     * This field is optional. If not specified, the default value is `TimeBased` .
     *
     * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-location-tracker.html#cfn-location-tracker-positionfiltering
     */
    readonly positionFiltering?: string;
    /**
     * @deprecated this property has been deprecated
     * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-location-tracker.html#cfn-location-tracker-pricingplan
     */
    readonly pricingPlan?: string;
    /**
     * @deprecated this property has been deprecated
     * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-location-tracker.html#cfn-location-tracker-pricingplandatasource
     */
    readonly pricingPlanDataSource?: string;
    /**
     * The name for the tracker resource.
     *
     * Requirements:
     *
     * - Contain only alphanumeric characters (A-Z, a-z, 0-9) , hyphens (-), periods (.), and underscores (_).
     * - Must be a unique tracker resource name.
     * - No spaces allowed. For example, `ExampleTracker` .
     *
     * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-location-tracker.html#cfn-location-tracker-trackername
     */
    readonly trackerName: string;
}

There is no eventBridgeEnabled in there.

Here is the record in my package.json

    "@aws-sdk/client-location": "^3.521.0",

Am I using the wrong version? Or any error in the configuration? Can you please help me debug?

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Feb 28, 2024
@pahud pahud added p3 and removed p2 labels Jun 11, 2024
@moelasmar moelasmar added @aws-cdk/aws-location-alpha Related to the @aws-cdk/aws-location-alpha package and removed @aws-cdk/aws-cloudformation Related to AWS CloudFormation aws-cdk-lib Related to the aws-cdk-lib package labels Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-location-alpha Related to the @aws-cdk/aws-location-alpha package bug This issue is a bug. p3
Projects
None yet
Development

No branches or pull requests

3 participants