I have an Issue with AWS Sitewise. Is there someon...
# aws
j
I have an Issue with AWS Sitewise. Is there someone here who can help me? (Details in thread)
I have an issue: Creating the asset models and assets works perfectly fine. But on a second run, I get the following errors:
Copy code
aws-native:iotsitewise:Asset ({asset-urn-redacted}):\n' +
{turbo node job redacted}:         '    error: operation UPDATE failed with "InvalidRequest": Invalid request provided: Hierarchy cannot use actual ID to reference asset model hierarchy\n' +
And here's the code:
Copy code
const asset = new Asset(`tmp-${name}`, {
    assetName: instanceArgs.name,
    assetExternalId: instanceArgs.externalId,
    assetModelId: model.assetModelId,
    assetProperties,
    assetHierarchies: Object.entries<Asset[]>(
        instanceArgs.children ?? {},
    ).flatMap(([modelName, childAssets]) => {
        return (childAssets ?? []).map((asset) => ({
            childAssetId: asset.assetId,
            logicalId: hierarchyLogicalId(modelName),
        }))
    }),
})
Is this maybe a bug in the resource implementation: Does the resource maybe use the actual id of the hiararchy from it's state when updating? Note 1: Resource creation works perfectly fine. So for the first run of the code everything works as intended. Note 2: The code might look dynamic but the inputs don't change between runs.
Btw: Is there any way where I can look at the implemtation of the resource?
I'm using
"@pulumi/aws-native": "^1.17.0"
q
Could you share a full example that we can use to dig into this? Afaik Sitewise has some special handling for IDs for many of it's resources where it does different things on create vs update.