Skip to content

Data Source: awsInspectorRulesPackages

The AWS Inspector Rules Packages data source allows access to the list of AWS Inspector Rules Packages which can be used by AWS Inspector within the region configured in the provider.

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 awsInspectorResourceGroupGroup =
  new aws.inspectorResourceGroup.InspectorResourceGroup(this, "group", {
    tags: {
      test: "test",
    },
  });
const dataAwsInspectorRulesPackagesRules =
  new aws.dataAwsInspectorRulesPackages.DataAwsInspectorRulesPackages(
    this,
    "rules",
    {}
  );
const awsInspectorAssessmentTargetAssessment =
  new aws.inspectorAssessmentTarget.InspectorAssessmentTarget(
    this,
    "assessment",
    {
      name: "test",
      resourceGroupArn: awsInspectorResourceGroupGroup.arn,
    }
  );
const awsInspectorAssessmentTemplateAssessment =
  new aws.inspectorAssessmentTemplate.InspectorAssessmentTemplate(
    this,
    "assessment_3",
    {
      duration: "60",
      name: "Test",
      rulesPackageArns: dataAwsInspectorRulesPackagesRules.arns,
      targetArn: awsInspectorAssessmentTargetAssessment.arn,
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
awsInspectorAssessmentTemplateAssessment.overrideLogicalId("assessment");

Attributes Reference

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

  • id - AWS Region.
  • arns - List of the AWS Inspector Rules Packages arns available in the AWS region.