From 006b9c1d1e57a34e6c95b69dbf60a2f00a93221a Mon Sep 17 00:00:00 2001 From: lodgei Date: Thu, 3 Apr 2025 20:47:04 +0000 Subject: [PATCH 1/7] initial commit, working standard output --- ...ockdataautomation_custom_output_project.tf | 33 ++++++++++++++++++ ...kdataautomation_standard_output_project.tf | 34 +++++++++++++++++++ .../bedrockdataautomation_project.md.tmpl | 31 +++++++++++++++++ 3 files changed, 98 insertions(+) create mode 100644 examples/resources/awscc_bedrockdataautomation_project/bedrockdataautomation_custom_output_project.tf create mode 100644 examples/resources/awscc_bedrockdataautomation_project/bedrockdataautomation_standard_output_project.tf create mode 100644 templates/resources/bedrockdataautomation_project.md.tmpl diff --git a/examples/resources/awscc_bedrockdataautomation_project/bedrockdataautomation_custom_output_project.tf b/examples/resources/awscc_bedrockdataautomation_project/bedrockdataautomation_custom_output_project.tf new file mode 100644 index 0000000000..de3a17cc3c --- /dev/null +++ b/examples/resources/awscc_bedrockdataautomation_project/bedrockdataautomation_custom_output_project.tf @@ -0,0 +1,33 @@ +resource "awscc_bedrockdataautomation_project" "example" { + project_name = "example-project" + custom_output_configuration = { + blueprints = [ + { + blueprint_arn = "arn:aws:bedrock:us-west-2::blueprint/" + } + ] + } + kms_encryption_context = "" + kms_key_id = "" + override_configuration = { + document = { + splitter = { + state = "ENABLED" + } + } + } + project_description = "example-description" + standard_output_configuration = { + document = { + outputFormat = { + textFormat = { + types = ["PLAIN_TEXT"] + } + additionalFileFormat = { + state = "ENABLED" + } + } + } + } + tags = "" +} \ No newline at end of file diff --git a/examples/resources/awscc_bedrockdataautomation_project/bedrockdataautomation_standard_output_project.tf b/examples/resources/awscc_bedrockdataautomation_project/bedrockdataautomation_standard_output_project.tf new file mode 100644 index 0000000000..7526d49830 --- /dev/null +++ b/examples/resources/awscc_bedrockdataautomation_project/bedrockdataautomation_standard_output_project.tf @@ -0,0 +1,34 @@ +resource "awscc_bedrock_data_automation_project" "example" { + project_name = "12345647891-example-project" + override_configuration = { + document = { + splitter = { + state = "ENABLED" + } + } + } + project_description = "example-description" + standard_output_configuration = { + document = { + extraction = { + granularity = { + types = ["DOCUMENT"] + } + bounding_box = { + state = "ENABLED" + } + } + generative_field = { + state = "DISABLED" + } + output_format = { + text_format = { + types = ["PLAIN_TEXT"] + } + additional_file_format = { + state = "DISABLED" + } + } + } + } +} \ No newline at end of file diff --git a/templates/resources/bedrockdataautomation_project.md.tmpl b/templates/resources/bedrockdataautomation_project.md.tmpl new file mode 100644 index 0000000000..2180c4351f --- /dev/null +++ b/templates/resources/bedrockdataautomation_project.md.tmpl @@ -0,0 +1,31 @@ +--- +page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" +subcategory: "" +description: |- +{{ .Description | plainmarkdown | trimspace | prefixlines " " }} +--- + +# {{.Name}} ({{.Type}}) + +{{ .Description | trimspace }} + +## Example Usage + +### Standard output +Create a Bedrock Data Automation project using standard outputs +{{ tffile (printf "examples/resources/%s/standard_output_project.tf" .Name)}} + +### Custom output +Create a Bedrock Data Automation project using custom outputs +{{ tffile (printf "examples/resources/%s/custom_output_project.tf" .Name)}} + +{{ .SchemaMarkdown | trimspace }} +{{- if .HasImport }} + +## Import + +Import is supported using the following syntax: + +{{ codefile "shell" .ImportFile }} + +{{- end }} \ No newline at end of file From 3368bd5feebb2e1f3e6c425c98da91b77ad2ca36 Mon Sep 17 00:00:00 2001 From: lodgei Date: Fri, 4 Apr 2025 12:21:54 +0000 Subject: [PATCH 2/7] working custom output --- ...ockdataautomation_custom_output_project.tf | 33 ++++++------ ...kdataautomation_standard_output_project.tf | 50 +++++++++---------- .../bedrockdataautomation_project.md.tmpl | 4 +- 3 files changed, 42 insertions(+), 45 deletions(-) diff --git a/examples/resources/awscc_bedrockdataautomation_project/bedrockdataautomation_custom_output_project.tf b/examples/resources/awscc_bedrockdataautomation_project/bedrockdataautomation_custom_output_project.tf index de3a17cc3c..62d7cae314 100644 --- a/examples/resources/awscc_bedrockdataautomation_project/bedrockdataautomation_custom_output_project.tf +++ b/examples/resources/awscc_bedrockdataautomation_project/bedrockdataautomation_custom_output_project.tf @@ -1,5 +1,18 @@ -resource "awscc_bedrockdataautomation_project" "example" { - project_name = "example-project" +resource "awscc_bedrock_data_automation_project" "example" { + project_name = "example-project" + project_description = "example-description" + standard_output_configuration = { + document = { + output_format = { + text_format = { + types = ["PLAIN_TEXT"] + } + additional_file_format = { + state = "DISABLED" + } + } + } + } custom_output_configuration = { blueprints = [ { @@ -7,8 +20,6 @@ resource "awscc_bedrockdataautomation_project" "example" { } ] } - kms_encryption_context = "" - kms_key_id = "" override_configuration = { document = { splitter = { @@ -16,18 +27,4 @@ resource "awscc_bedrockdataautomation_project" "example" { } } } - project_description = "example-description" - standard_output_configuration = { - document = { - outputFormat = { - textFormat = { - types = ["PLAIN_TEXT"] - } - additionalFileFormat = { - state = "ENABLED" - } - } - } - } - tags = "" } \ No newline at end of file diff --git a/examples/resources/awscc_bedrockdataautomation_project/bedrockdataautomation_standard_output_project.tf b/examples/resources/awscc_bedrockdataautomation_project/bedrockdataautomation_standard_output_project.tf index 7526d49830..aa5343708d 100644 --- a/examples/resources/awscc_bedrockdataautomation_project/bedrockdataautomation_standard_output_project.tf +++ b/examples/resources/awscc_bedrockdataautomation_project/bedrockdataautomation_standard_output_project.tf @@ -1,5 +1,29 @@ resource "awscc_bedrock_data_automation_project" "example" { - project_name = "12345647891-example-project" + project_name = "example-project" + project_description = "example-description" + standard_output_configuration = { + document = { + extraction = { + granularity = { + types = ["DOCUMENT"] + } + bounding_box = { + state = "ENABLED" + } + } + generative_field = { + state = "DISABLED" + } + output_format = { + text_format = { + types = ["PLAIN_TEXT"] + } + additional_file_format = { + state = "DISABLED" + } + } + } + } override_configuration = { document = { splitter = { @@ -7,28 +31,4 @@ resource "awscc_bedrock_data_automation_project" "example" { } } } - project_description = "example-description" - standard_output_configuration = { - document = { - extraction = { - granularity = { - types = ["DOCUMENT"] - } - bounding_box = { - state = "ENABLED" - } - } - generative_field = { - state = "DISABLED" - } - output_format = { - text_format = { - types = ["PLAIN_TEXT"] - } - additional_file_format = { - state = "DISABLED" - } - } - } - } } \ No newline at end of file diff --git a/templates/resources/bedrockdataautomation_project.md.tmpl b/templates/resources/bedrockdataautomation_project.md.tmpl index 2180c4351f..3ece861624 100644 --- a/templates/resources/bedrockdataautomation_project.md.tmpl +++ b/templates/resources/bedrockdataautomation_project.md.tmpl @@ -12,11 +12,11 @@ description: |- ## Example Usage ### Standard output -Create a Bedrock Data Automation project using standard outputs +Create a Bedrock Data Automation project using standard outputs using the document modality {{ tffile (printf "examples/resources/%s/standard_output_project.tf" .Name)}} ### Custom output -Create a Bedrock Data Automation project using custom outputs +Create a Bedrock Data Automation project using custom outputs using the document modality {{ tffile (printf "examples/resources/%s/custom_output_project.tf" .Name)}} {{ .SchemaMarkdown | trimspace }} From 62ccb9d25c72077ec26b406123a632e20438015b Mon Sep 17 00:00:00 2001 From: lodgei Date: Fri, 4 Apr 2025 12:22:35 +0000 Subject: [PATCH 3/7] updated md --- templates/resources/bedrockdataautomation_project.md.tmpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/resources/bedrockdataautomation_project.md.tmpl b/templates/resources/bedrockdataautomation_project.md.tmpl index 3ece861624..864618c2e5 100644 --- a/templates/resources/bedrockdataautomation_project.md.tmpl +++ b/templates/resources/bedrockdataautomation_project.md.tmpl @@ -12,11 +12,11 @@ description: |- ## Example Usage ### Standard output -Create a Bedrock Data Automation project using standard outputs using the document modality +Create a Bedrock Data Automation project with standard outputs using the document modality {{ tffile (printf "examples/resources/%s/standard_output_project.tf" .Name)}} ### Custom output -Create a Bedrock Data Automation project using custom outputs using the document modality +Create a Bedrock Data Automation project with custom outputs using the document modality {{ tffile (printf "examples/resources/%s/custom_output_project.tf" .Name)}} {{ .SchemaMarkdown | trimspace }} From bdb753ec6408213c13c9424a51a0901b1138713e Mon Sep 17 00:00:00 2001 From: lodgei Date: Fri, 4 Apr 2025 12:26:42 +0000 Subject: [PATCH 4/7] add example for: Bedrock Data Automation Project --- templates/resources/bedrockdataautomation_project.md.tmpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/resources/bedrockdataautomation_project.md.tmpl b/templates/resources/bedrockdataautomation_project.md.tmpl index 864618c2e5..77c2bc9d66 100644 --- a/templates/resources/bedrockdataautomation_project.md.tmpl +++ b/templates/resources/bedrockdataautomation_project.md.tmpl @@ -12,11 +12,11 @@ description: |- ## Example Usage ### Standard output -Create a Bedrock Data Automation project with standard outputs using the document modality +Create a Bedrock Data Automation project with standard output using the document modality {{ tffile (printf "examples/resources/%s/standard_output_project.tf" .Name)}} ### Custom output -Create a Bedrock Data Automation project with custom outputs using the document modality +Create a Bedrock Data Automation project with custom output using the document modality {{ tffile (printf "examples/resources/%s/custom_output_project.tf" .Name)}} {{ .SchemaMarkdown | trimspace }} From 40a0ff9d709e06e84bd2fec9198be8bf9b2e73ad Mon Sep 17 00:00:00 2001 From: lodgei Date: Fri, 4 Apr 2025 15:36:41 +0000 Subject: [PATCH 5/7] updated directory naming conventions --- ...k_data_automation_custom_output_project.tf | 30 ++++++++++++++++ ...data_automation_standard_output_project.tf | 34 +++++++++++++++++++ .../bedrock_data_automation_project.md.tmpl | 31 +++++++++++++++++ 3 files changed, 95 insertions(+) create mode 100644 examples/resources/awscc_bedrock_data_automation_project/bedrock_data_automation_custom_output_project.tf create mode 100644 examples/resources/awscc_bedrock_data_automation_project/bedrock_data_automation_standard_output_project.tf create mode 100644 templates/resources/bedrock_data_automation_project.md.tmpl diff --git a/examples/resources/awscc_bedrock_data_automation_project/bedrock_data_automation_custom_output_project.tf b/examples/resources/awscc_bedrock_data_automation_project/bedrock_data_automation_custom_output_project.tf new file mode 100644 index 0000000000..62d7cae314 --- /dev/null +++ b/examples/resources/awscc_bedrock_data_automation_project/bedrock_data_automation_custom_output_project.tf @@ -0,0 +1,30 @@ +resource "awscc_bedrock_data_automation_project" "example" { + project_name = "example-project" + project_description = "example-description" + standard_output_configuration = { + document = { + output_format = { + text_format = { + types = ["PLAIN_TEXT"] + } + additional_file_format = { + state = "DISABLED" + } + } + } + } + custom_output_configuration = { + blueprints = [ + { + blueprint_arn = "arn:aws:bedrock:us-west-2::blueprint/" + } + ] + } + override_configuration = { + document = { + splitter = { + state = "ENABLED" + } + } + } +} \ No newline at end of file diff --git a/examples/resources/awscc_bedrock_data_automation_project/bedrock_data_automation_standard_output_project.tf b/examples/resources/awscc_bedrock_data_automation_project/bedrock_data_automation_standard_output_project.tf new file mode 100644 index 0000000000..aa5343708d --- /dev/null +++ b/examples/resources/awscc_bedrock_data_automation_project/bedrock_data_automation_standard_output_project.tf @@ -0,0 +1,34 @@ +resource "awscc_bedrock_data_automation_project" "example" { + project_name = "example-project" + project_description = "example-description" + standard_output_configuration = { + document = { + extraction = { + granularity = { + types = ["DOCUMENT"] + } + bounding_box = { + state = "ENABLED" + } + } + generative_field = { + state = "DISABLED" + } + output_format = { + text_format = { + types = ["PLAIN_TEXT"] + } + additional_file_format = { + state = "DISABLED" + } + } + } + } + override_configuration = { + document = { + splitter = { + state = "ENABLED" + } + } + } +} \ No newline at end of file diff --git a/templates/resources/bedrock_data_automation_project.md.tmpl b/templates/resources/bedrock_data_automation_project.md.tmpl new file mode 100644 index 0000000000..77c2bc9d66 --- /dev/null +++ b/templates/resources/bedrock_data_automation_project.md.tmpl @@ -0,0 +1,31 @@ +--- +page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" +subcategory: "" +description: |- +{{ .Description | plainmarkdown | trimspace | prefixlines " " }} +--- + +# {{.Name}} ({{.Type}}) + +{{ .Description | trimspace }} + +## Example Usage + +### Standard output +Create a Bedrock Data Automation project with standard output using the document modality +{{ tffile (printf "examples/resources/%s/standard_output_project.tf" .Name)}} + +### Custom output +Create a Bedrock Data Automation project with custom output using the document modality +{{ tffile (printf "examples/resources/%s/custom_output_project.tf" .Name)}} + +{{ .SchemaMarkdown | trimspace }} +{{- if .HasImport }} + +## Import + +Import is supported using the following syntax: + +{{ codefile "shell" .ImportFile }} + +{{- end }} \ No newline at end of file From 45bf46c241154190e0a5e68dd0ebbf84ecce57f9 Mon Sep 17 00:00:00 2001 From: lodgei Date: Fri, 4 Apr 2025 17:24:31 +0000 Subject: [PATCH 6/7] run make docs --- .../bedrock_data_automation_project.md | 77 ++++++++++++++++++- ...k_data_automation_custom_output_project.tf | 10 +-- ...data_automation_standard_output_project.tf | 24 +++--- .../bedrock_data_automation_project.md.tmpl | 4 +- .../bedrockdataautomation_project.md.tmpl | 31 -------- 5 files changed, 94 insertions(+), 52 deletions(-) delete mode 100644 templates/resources/bedrockdataautomation_project.md.tmpl diff --git a/docs/resources/bedrock_data_automation_project.md b/docs/resources/bedrock_data_automation_project.md index f676d5f151..ffed42c9de 100644 --- a/docs/resources/bedrock_data_automation_project.md +++ b/docs/resources/bedrock_data_automation_project.md @@ -1,5 +1,4 @@ --- -# generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "awscc_bedrock_data_automation_project Resource - terraform-provider-awscc" subcategory: "" description: |- @@ -10,7 +9,81 @@ description: |- Definition of AWS::Bedrock::DataAutomationProject Resource Type +## Example Usage + +### Standard output +Create a Bedrock Data Automation project with standard output using the document modality +```terraform +resource "awscc_bedrock_data_automation_project" "example" { + project_name = "example-project" + project_description = "example-description" + standard_output_configuration = { + document = { + extraction = { + granularity = { + types = ["DOCUMENT"] + } + bounding_box = { + state = "ENABLED" + } + } + generative_field = { + state = "DISABLED" + } + output_format = { + text_format = { + types = ["PLAIN_TEXT"] + } + additional_file_format = { + state = "DISABLED" + } + } + } + } + override_configuration = { + document = { + splitter = { + state = "ENABLED" + } + } + } +} +``` +### Custom output +Create a Bedrock Data Automation project with custom output using the document modality +```terraform +resource "awscc_bedrock_data_automation_project" "example" { + project_name = "example-project" + project_description = "example-description" + standard_output_configuration = { + document = { + output_format = { + text_format = { + types = ["PLAIN_TEXT"] + } + additional_file_format = { + state = "DISABLED" + } + } + } + } + custom_output_configuration = { + blueprints = [ + { + blueprint_arn = "arn:aws:bedrock:us-west-2::blueprint/" + } + ] + } + override_configuration = { + document = { + splitter = { + state = "ENABLED" + } + } + } +} +``` ## Schema @@ -296,4 +369,4 @@ Import is supported using the following syntax: ```shell $ terraform import awscc_bedrock_data_automation_project.example "project_arn" -``` +``` \ No newline at end of file diff --git a/examples/resources/awscc_bedrock_data_automation_project/bedrock_data_automation_custom_output_project.tf b/examples/resources/awscc_bedrock_data_automation_project/bedrock_data_automation_custom_output_project.tf index 62d7cae314..e34deef0ef 100644 --- a/examples/resources/awscc_bedrock_data_automation_project/bedrock_data_automation_custom_output_project.tf +++ b/examples/resources/awscc_bedrock_data_automation_project/bedrock_data_automation_custom_output_project.tf @@ -4,11 +4,11 @@ resource "awscc_bedrock_data_automation_project" "example" { standard_output_configuration = { document = { output_format = { - text_format = { - types = ["PLAIN_TEXT"] - } - additional_file_format = { - state = "DISABLED" + text_format = { + types = ["PLAIN_TEXT"] + } + additional_file_format = { + state = "DISABLED" } } } diff --git a/examples/resources/awscc_bedrock_data_automation_project/bedrock_data_automation_standard_output_project.tf b/examples/resources/awscc_bedrock_data_automation_project/bedrock_data_automation_standard_output_project.tf index aa5343708d..f0ef219303 100644 --- a/examples/resources/awscc_bedrock_data_automation_project/bedrock_data_automation_standard_output_project.tf +++ b/examples/resources/awscc_bedrock_data_automation_project/bedrock_data_automation_standard_output_project.tf @@ -4,22 +4,22 @@ resource "awscc_bedrock_data_automation_project" "example" { standard_output_configuration = { document = { extraction = { - granularity = { - types = ["DOCUMENT"] - } - bounding_box = { - state = "ENABLED" - } + granularity = { + types = ["DOCUMENT"] + } + bounding_box = { + state = "ENABLED" + } } generative_field = { - state = "DISABLED" + state = "DISABLED" } output_format = { - text_format = { - types = ["PLAIN_TEXT"] - } - additional_file_format = { - state = "DISABLED" + text_format = { + types = ["PLAIN_TEXT"] + } + additional_file_format = { + state = "DISABLED" } } } diff --git a/templates/resources/bedrock_data_automation_project.md.tmpl b/templates/resources/bedrock_data_automation_project.md.tmpl index 77c2bc9d66..474ae1fabf 100644 --- a/templates/resources/bedrock_data_automation_project.md.tmpl +++ b/templates/resources/bedrock_data_automation_project.md.tmpl @@ -13,11 +13,11 @@ description: |- ### Standard output Create a Bedrock Data Automation project with standard output using the document modality -{{ tffile (printf "examples/resources/%s/standard_output_project.tf" .Name)}} +{{ tffile (printf "examples/resources/%s/bedrock_data_automation_standard_output_project.tf" .Name)}} ### Custom output Create a Bedrock Data Automation project with custom output using the document modality -{{ tffile (printf "examples/resources/%s/custom_output_project.tf" .Name)}} +{{ tffile (printf "examples/resources/%s/bedrock_data_automation_custom_output_project.tf" .Name)}} {{ .SchemaMarkdown | trimspace }} {{- if .HasImport }} diff --git a/templates/resources/bedrockdataautomation_project.md.tmpl b/templates/resources/bedrockdataautomation_project.md.tmpl deleted file mode 100644 index 77c2bc9d66..0000000000 --- a/templates/resources/bedrockdataautomation_project.md.tmpl +++ /dev/null @@ -1,31 +0,0 @@ ---- -page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" -subcategory: "" -description: |- -{{ .Description | plainmarkdown | trimspace | prefixlines " " }} ---- - -# {{.Name}} ({{.Type}}) - -{{ .Description | trimspace }} - -## Example Usage - -### Standard output -Create a Bedrock Data Automation project with standard output using the document modality -{{ tffile (printf "examples/resources/%s/standard_output_project.tf" .Name)}} - -### Custom output -Create a Bedrock Data Automation project with custom output using the document modality -{{ tffile (printf "examples/resources/%s/custom_output_project.tf" .Name)}} - -{{ .SchemaMarkdown | trimspace }} -{{- if .HasImport }} - -## Import - -Import is supported using the following syntax: - -{{ codefile "shell" .ImportFile }} - -{{- end }} \ No newline at end of file From 6b934470781cc5deae542ba9a32f6d424f630aab Mon Sep 17 00:00:00 2001 From: Ian Lodge <135351711+professional-ian@users.noreply.github.com> Date: Fri, 18 Apr 2025 09:25:40 -0400 Subject: [PATCH 7/7] Apply suggestions from code review Co-authored-by: Manu Chandrasekhar --- docs/resources/bedrock_data_automation_project.md | 8 ++++++-- .../bedrock_data_automation_custom_output_project.tf | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/resources/bedrock_data_automation_project.md b/docs/resources/bedrock_data_automation_project.md index ffed42c9de..8cb662da21 100644 --- a/docs/resources/bedrock_data_automation_project.md +++ b/docs/resources/bedrock_data_automation_project.md @@ -71,7 +71,7 @@ resource "awscc_bedrock_data_automation_project" "example" { custom_output_configuration = { blueprints = [ { - blueprint_arn = "arn:aws:bedrock:us-west-2::blueprint/" + blueprint_arn = awscc_bedrock_blueprint.example.blueprint_arn } ] } @@ -81,7 +81,11 @@ resource "awscc_bedrock_data_automation_project" "example" { state = "ENABLED" } } - } + + tags = [{ + key = "ModifiedBy" + value = "AWSCC" + }] } ``` diff --git a/examples/resources/awscc_bedrock_data_automation_project/bedrock_data_automation_custom_output_project.tf b/examples/resources/awscc_bedrock_data_automation_project/bedrock_data_automation_custom_output_project.tf index e34deef0ef..dbecbea413 100644 --- a/examples/resources/awscc_bedrock_data_automation_project/bedrock_data_automation_custom_output_project.tf +++ b/examples/resources/awscc_bedrock_data_automation_project/bedrock_data_automation_custom_output_project.tf @@ -16,7 +16,7 @@ resource "awscc_bedrock_data_automation_project" "example" { custom_output_configuration = { blueprints = [ { - blueprint_arn = "arn:aws:bedrock:us-west-2::blueprint/" + blueprint_arn = awscc_bedrock_blueprint.example.blueprint_arn } ] }