-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
95c610b
commit 783486d
Showing
18 changed files
with
825 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
package data | ||
|
||
import ( | ||
"encoding/json" | ||
|
||
tfjson "github.com/hashicorp/terraform-json" | ||
) | ||
|
||
const awsEc2CapacityBlockOffering = `{ | ||
"block": { | ||
"attributes": { | ||
"availability_zone": { | ||
"computed": true, | ||
"description_kind": "plain", | ||
"type": "string" | ||
}, | ||
"capacity_block_offering_id": { | ||
"computed": true, | ||
"description_kind": "plain", | ||
"type": "string" | ||
}, | ||
"capacity_duration_hours": { | ||
"description_kind": "plain", | ||
"required": true, | ||
"type": "number" | ||
}, | ||
"currency_code": { | ||
"computed": true, | ||
"description_kind": "plain", | ||
"type": "string" | ||
}, | ||
"end_date_range": { | ||
"computed": true, | ||
"description_kind": "plain", | ||
"optional": true, | ||
"type": "string" | ||
}, | ||
"instance_count": { | ||
"description_kind": "plain", | ||
"required": true, | ||
"type": "number" | ||
}, | ||
"instance_type": { | ||
"description_kind": "plain", | ||
"required": true, | ||
"type": "string" | ||
}, | ||
"start_date_range": { | ||
"computed": true, | ||
"description_kind": "plain", | ||
"optional": true, | ||
"type": "string" | ||
}, | ||
"tenancy": { | ||
"computed": true, | ||
"description_kind": "plain", | ||
"type": "string" | ||
}, | ||
"upfront_fee": { | ||
"computed": true, | ||
"description_kind": "plain", | ||
"type": "string" | ||
} | ||
}, | ||
"description_kind": "plain" | ||
}, | ||
"version": 0 | ||
}` | ||
|
||
func AwsEc2CapacityBlockOfferingSchema() *tfjson.Schema { | ||
var result tfjson.Schema | ||
_ = json.Unmarshal([]byte(awsEc2CapacityBlockOffering), &result) | ||
return &result | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package data_test | ||
|
||
import ( | ||
"testing" | ||
|
||
tfjson "github.com/hashicorp/terraform-json" | ||
"github.com/lonegunmanb/terraform-aws-schema/v5/generated/data" | ||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestAwsEc2CapacityBlockOfferingSchema(t *testing.T) { | ||
defaultSchema := &tfjson.Schema{} | ||
s := data.AwsEc2CapacityBlockOfferingSchema() | ||
assert.NotNil(t, s) | ||
assert.NotEqual(t, defaultSchema, s) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,170 @@ | ||
package resource | ||
|
||
import ( | ||
"encoding/json" | ||
|
||
tfjson "github.com/hashicorp/terraform-json" | ||
) | ||
|
||
const awsAppfabricAppAuthorization = `{ | ||
"block": { | ||
"attributes": { | ||
"app": { | ||
"description_kind": "plain", | ||
"required": true, | ||
"type": "string" | ||
}, | ||
"app_bundle_arn": { | ||
"description_kind": "plain", | ||
"required": true, | ||
"type": "string" | ||
}, | ||
"arn": { | ||
"computed": true, | ||
"description_kind": "plain", | ||
"type": "string" | ||
}, | ||
"auth_type": { | ||
"description_kind": "plain", | ||
"required": true, | ||
"type": "string" | ||
}, | ||
"auth_url": { | ||
"computed": true, | ||
"description_kind": "plain", | ||
"type": "string" | ||
}, | ||
"created_at": { | ||
"computed": true, | ||
"description_kind": "plain", | ||
"type": "string" | ||
}, | ||
"id": { | ||
"computed": true, | ||
"description_kind": "plain", | ||
"type": "string" | ||
}, | ||
"persona": { | ||
"computed": true, | ||
"description_kind": "plain", | ||
"type": "string" | ||
}, | ||
"tags": { | ||
"description_kind": "plain", | ||
"optional": true, | ||
"type": [ | ||
"map", | ||
"string" | ||
] | ||
}, | ||
"tags_all": { | ||
"computed": true, | ||
"description_kind": "plain", | ||
"type": [ | ||
"map", | ||
"string" | ||
] | ||
}, | ||
"updated_at": { | ||
"computed": true, | ||
"description_kind": "plain", | ||
"type": "string" | ||
} | ||
}, | ||
"block_types": { | ||
"credential": { | ||
"block": { | ||
"block_types": { | ||
"api_key_credential": { | ||
"block": { | ||
"attributes": { | ||
"api_key": { | ||
"description_kind": "plain", | ||
"required": true, | ||
"sensitive": true, | ||
"type": "string" | ||
} | ||
}, | ||
"description_kind": "plain" | ||
}, | ||
"nesting_mode": "list" | ||
}, | ||
"oauth2_credential": { | ||
"block": { | ||
"attributes": { | ||
"client_id": { | ||
"description_kind": "plain", | ||
"required": true, | ||
"type": "string" | ||
}, | ||
"client_secret": { | ||
"description_kind": "plain", | ||
"required": true, | ||
"sensitive": true, | ||
"type": "string" | ||
} | ||
}, | ||
"description_kind": "plain" | ||
}, | ||
"nesting_mode": "list" | ||
} | ||
}, | ||
"description_kind": "plain" | ||
}, | ||
"nesting_mode": "list" | ||
}, | ||
"tenant": { | ||
"block": { | ||
"attributes": { | ||
"tenant_display_name": { | ||
"description_kind": "plain", | ||
"required": true, | ||
"type": "string" | ||
}, | ||
"tenant_identifier": { | ||
"description_kind": "plain", | ||
"required": true, | ||
"type": "string" | ||
} | ||
}, | ||
"description_kind": "plain" | ||
}, | ||
"nesting_mode": "list" | ||
}, | ||
"timeouts": { | ||
"block": { | ||
"attributes": { | ||
"create": { | ||
"description": "A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as \"30s\" or \"2h45m\". Valid time units are \"s\" (seconds), \"m\" (minutes), \"h\" (hours).", | ||
"description_kind": "plain", | ||
"optional": true, | ||
"type": "string" | ||
}, | ||
"delete": { | ||
"description": "A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as \"30s\" or \"2h45m\". Valid time units are \"s\" (seconds), \"m\" (minutes), \"h\" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.", | ||
"description_kind": "plain", | ||
"optional": true, | ||
"type": "string" | ||
}, | ||
"update": { | ||
"description": "A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as \"30s\" or \"2h45m\". Valid time units are \"s\" (seconds), \"m\" (minutes), \"h\" (hours).", | ||
"description_kind": "plain", | ||
"optional": true, | ||
"type": "string" | ||
} | ||
}, | ||
"description_kind": "plain" | ||
}, | ||
"nesting_mode": "single" | ||
} | ||
}, | ||
"description_kind": "plain" | ||
}, | ||
"version": 0 | ||
}` | ||
|
||
func AwsAppfabricAppAuthorizationSchema() *tfjson.Schema { | ||
var result tfjson.Schema | ||
_ = json.Unmarshal([]byte(awsAppfabricAppAuthorization), &result) | ||
return &result | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package resource_test | ||
|
||
import ( | ||
"testing" | ||
|
||
tfjson "github.com/hashicorp/terraform-json" | ||
"github.com/lonegunmanb/terraform-aws-schema/v5/generated/resource" | ||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestAwsAppfabricAppAuthorizationSchema(t *testing.T) { | ||
defaultSchema := &tfjson.Schema{} | ||
s := resource.AwsAppfabricAppAuthorizationSchema() | ||
assert.NotNil(t, s) | ||
assert.NotEqual(t, defaultSchema, s) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package resource | ||
|
||
import ( | ||
"encoding/json" | ||
|
||
tfjson "github.com/hashicorp/terraform-json" | ||
) | ||
|
||
const awsAppfabricAppBundle = `{ | ||
"block": { | ||
"attributes": { | ||
"arn": { | ||
"computed": true, | ||
"description_kind": "plain", | ||
"type": "string" | ||
}, | ||
"customer_managed_key_arn": { | ||
"description_kind": "plain", | ||
"optional": true, | ||
"type": "string" | ||
}, | ||
"id": { | ||
"computed": true, | ||
"description_kind": "plain", | ||
"type": "string" | ||
}, | ||
"tags": { | ||
"description_kind": "plain", | ||
"optional": true, | ||
"type": [ | ||
"map", | ||
"string" | ||
] | ||
}, | ||
"tags_all": { | ||
"computed": true, | ||
"description_kind": "plain", | ||
"type": [ | ||
"map", | ||
"string" | ||
] | ||
} | ||
}, | ||
"description_kind": "plain" | ||
}, | ||
"version": 0 | ||
}` | ||
|
||
func AwsAppfabricAppBundleSchema() *tfjson.Schema { | ||
var result tfjson.Schema | ||
_ = json.Unmarshal([]byte(awsAppfabricAppBundle), &result) | ||
return &result | ||
} |
Oops, something went wrong.