Skip to content

Data Source: awsOutpostsAsset

Information about a specific hardware asset in an Outpost.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
const dataAwsOutpostsAssetsExample =
  new aws.dataAwsOutpostsAssets.DataAwsOutpostsAssets(this, "example", {
    arn: "${data.aws_outposts_outpost.example.arn}",
  });
const dataAwsOutpostsAssetExample =
  new aws.dataAwsOutpostsAsset.DataAwsOutpostsAsset(this, "example_1", {
    arn: "${data.aws_outposts_outpost.example.arn}",
    assetId: "${element(data.aws_outposts_assets.this.asset_ids, count.index)}",
  });
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
dataAwsOutpostsAssetExample.overrideLogicalId("example");
/*In most cases loops should be handled in the programming language context and 
not inside of the Terraform context. If you are looping over something external, e.g. a variable or a file input
you should consider using a for loop. If you are looping over something only known to Terraform, e.g. a result of a data source
you need to keep this like it is.*/
dataAwsOutpostsAssetExample.addOverride(
  "count",
  `\${length(${dataAwsOutpostsAssetsExample.assetIds})}`
);

Argument Reference

The following arguments are required:

  • arn - (Required) Outpost ARN.
  • assetId - (Required) ID of the asset.

Attribute Reference

In addition to all arguments above, the following attributes are exported:

  • assetType - Type of the asset.
  • hostId - Host ID of the Dedicated Hosts on the asset, if a Dedicated Host is provisioned.
  • rackElevation - Position of an asset in a rack measured in rack units.
  • rackId - Rack ID of the asset.