Skip to content

Commit

Permalink
hashicorp#21979 add new schema for bucket_criteria
Browse files Browse the repository at this point in the history
  • Loading branch information
nick committed Aug 8, 2022
1 parent 744ddbb commit 46ad9e9
Showing 1 changed file with 174 additions and 2 deletions.
176 changes: 174 additions & 2 deletions internal/service/macie2/classification_job.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,9 @@ func ResourceClassificationJob() *schema.Resource {
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"bucket_definitions": {
Type: schema.TypeList,
Optional: true,
ConflictsWith: []string{"s3_job_definition.0.bucket_criteria"},
Type: schema.TypeList,
Optional: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"account_id": {
Expand All @@ -130,6 +131,177 @@ func ResourceClassificationJob() *schema.Resource {
},
},
},
"bucket_criteria": {
ConflictsWith: []string{"s3_job_definition.0.bucket_definitions"},
Type: schema.TypeList,
Optional: true,
Computed: true,
MaxItems: 1,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"excludes": {
Type: schema.TypeList,
Optional: true,
Computed: true,
MaxItems: 1,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"and": {
Type: schema.TypeList,
Optional: true,
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"simple_criterion": {
Type: schema.TypeList,
Optional: true,
Computed: true,
MaxItems: 1,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"comparator": {
Type: schema.TypeString,
Optional: true,
Computed: true,
ValidateFunc: validation.StringInSlice(macie2.JobComparator_Values(), false),
},
"values": {
Type: schema.TypeList,
Optional: true,
Computed: true,
Elem: &schema.Schema{Type: schema.TypeString},
},
"key": {
Type: schema.TypeString,
Optional: true,
Computed: true,
},
},
},
},
"tag_criterion": {
Type: schema.TypeList,
Optional: true,
Computed: true,
MaxItems: 1,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"comparator": {
Type: schema.TypeString,
Optional: true,
Computed: true,
ValidateFunc: validation.StringInSlice(macie2.JobComparator_Values(), false),
},
"tag_values": {
Type: schema.TypeList,
Optional: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"value": {
Type: schema.TypeString,
Optional: true,
Computed: true,
},
"key": {
Type: schema.TypeString,
Optional: true,
Computed: true,
},
},
},
},
},
},
},
},
},
},
},
},
},
"includes": {
Type: schema.TypeList,
Optional: true,
Computed: true,
MaxItems: 1,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"and": {
Type: schema.TypeList,
Optional: true,
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"simple_criterion": {
Type: schema.TypeList,
Optional: true,
Computed: true,
MaxItems: 1,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"comparator": {
Type: schema.TypeString,
Optional: true,
Computed: true,
ValidateFunc: validation.StringInSlice(macie2.JobComparator_Values(), false),
},
"values": {
Type: schema.TypeList,
Optional: true,
Computed: true,
Elem: &schema.Schema{Type: schema.TypeString},
},
"key": {
Type: schema.TypeString,
Optional: true,
Computed: true,
},
},
},
},
"tag_criterion": {
Type: schema.TypeList,
Optional: true,
Computed: true,
MaxItems: 1,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"comparator": {
Type: schema.TypeString,
Optional: true,
Computed: true,
ValidateFunc: validation.StringInSlice(macie2.JobComparator_Values(), false),
},
"tag_values": {
Type: schema.TypeList,
Optional: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"value": {
Type: schema.TypeString,
Optional: true,
Computed: true,
},
"key": {
Type: schema.TypeString,
Optional: true,
Computed: true,
},
},
},
},
},
},
},
},
},
},
},
},
},
},
},
},
"scoping": {
Type: schema.TypeList,
Optional: true,
Expand Down

0 comments on commit 46ad9e9

Please sign in to comment.