forked from rebuy-de/aws-nuke
-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cl 937 bedrock #33
Merged
Merged
Cl 937 bedrock #33
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
4b8ea2e
Bump github.com/aws/aws-sdk-go from 1.53.10 to 1.53.15 in the golang …
dependabot[bot] 18db9cc
Bump the golang group across 1 directory with 2 updates (#1238)
dependabot[bot] c24e393
Bump github.com/aws/aws-sdk-go from 1.54.7 to 1.54.19 in the golang g…
dependabot[bot] bc5b576
Add .editorconfig
terraform-cluster-config[bot] 4b66bbf
Merge branch 'main' into CL-937-bedrock
corybekk 0856ebf
added bedrock agent alias module
corybekk 1a5034e
added bedrock flow alias module
corybekk 5ea0b67
added filters for aws managed aliases
corybekk 1e5142c
remove agent alias filter
corybekk 2e67160
added alias properties
corybekk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,132 @@ | ||
# Distributed via https://github.com/rebuy-de/terraform-cluster-config | ||
# Modify only there, changes in project repos will be overwritten | ||
|
||
root = true | ||
|
||
[openapi-spec.yaml] | ||
ij_formatter_enabled = false | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
indent_size = 4 | ||
indent_style = space | ||
insert_final_newline = true | ||
max_line_length = 120 | ||
tab_width = 4 | ||
trim_trailing_whitespace = true | ||
ij_continuation_indent_size = 8 | ||
ij_formatter_off_tag = @formatter:off | ||
ij_formatter_on_tag = @formatter:on | ||
ij_formatter_tags_enabled = true | ||
ij_smart_tabs = false | ||
ij_visual_guides = | ||
ij_wrap_on_typing = false | ||
|
||
[{*.htm,*.html,*.sht,*.shtm,*.shtml}] | ||
ij_html_attribute_wrap = off | ||
ij_html_do_not_indent_children_of_tags = | ||
ij_html_keep_blank_lines = 1 | ||
ij_html_text_wrap = off | ||
|
||
[{*.cjs,*.js}] | ||
ij_javascript_do_while_brace_force = always | ||
ij_javascript_for_brace_force = always | ||
ij_javascript_if_brace_force = always | ||
ij_javascript_keep_blank_lines_in_code = 1 | ||
ij_javascript_use_double_quotes = false | ||
ij_javascript_while_brace_force = always | ||
|
||
[{*.ats,*.cts,*.mts,*.ts}] | ||
ij_typescript_do_while_brace_force = always | ||
ij_typescript_for_brace_force = always | ||
ij_typescript_if_brace_force = always | ||
ij_typescript_import_prefer_absolute_path = true | ||
ij_typescript_keep_blank_lines_in_code = 1 | ||
ij_typescript_space_before_function_left_parenth = false | ||
ij_typescript_use_double_quotes = false | ||
ij_typescript_while_brace_force = always | ||
|
||
[*.coffee] | ||
indent_size = 2 | ||
|
||
[*.java] | ||
ij_continuation_indent_size = 4 | ||
ij_java_blank_lines_around_field = 1 | ||
ij_java_blank_lines_around_initializer = 0 | ||
ij_java_class_brace_style = next_line | ||
ij_java_class_count_to_use_import_on_demand = 99 | ||
ij_java_do_while_brace_force = always | ||
ij_java_doc_add_blank_line_after_param_comments = true | ||
ij_java_doc_add_blank_line_after_return = true | ||
ij_java_for_brace_force = always | ||
ij_java_if_brace_force = always | ||
ij_java_keep_blank_lines_before_right_brace = 0 | ||
ij_java_keep_blank_lines_in_code = 1 | ||
ij_java_keep_blank_lines_in_declarations = 0 | ||
ij_java_keep_simple_classes_in_one_line = true | ||
ij_java_keep_simple_lambdas_in_one_line = true | ||
ij_java_method_brace_style = next_line | ||
ij_java_names_count_to_use_import_on_demand = 99 | ||
ij_java_new_line_after_lparen_in_record_header = true | ||
ij_java_packages_to_use_import_on_demand = | ||
ij_java_record_components_wrap = on_every_item | ||
ij_java_rparen_on_new_line_in_record_header = true | ||
ij_java_while_brace_force = always | ||
|
||
[{*.kt,*.kts}] | ||
ij_continuation_indent_size = 4 | ||
ij_kotlin_code_style_defaults = KOTLIN_OFFICIAL | ||
ij_kotlin_name_count_to_use_star_import = 2147483647 | ||
ij_kotlin_name_count_to_use_star_import_for_members = 2147483647 | ||
ij_kotlin_packages_to_use_import_on_demand = | ||
|
||
[{*.ctp,*.hphp,*.inc,*.module,*.php,*.php4,*.php5,*.phtml}] | ||
ij_php_align_multiline_parameters = false | ||
ij_php_blank_lines_around_field = 1 | ||
ij_php_blank_lines_before_return_statement = 1 | ||
ij_php_comma_after_last_array_element = true | ||
ij_php_force_short_declaration_array_style = true | ||
ij_php_keep_blank_lines_before_right_brace = 0 | ||
ij_php_keep_blank_lines_in_code = 1 | ||
ij_php_keep_blank_lines_in_declarations = 0 | ||
ij_php_keep_rparen_and_lbrace_on_one_line = true | ||
ij_php_lower_case_boolean_const = true | ||
ij_php_lower_case_null_const = true | ||
ij_php_method_parameters_new_line_after_left_paren = true | ||
ij_php_method_parameters_right_paren_on_new_line = true | ||
ij_php_phpdoc_blank_line_before_tags = true | ||
ij_php_phpdoc_blank_lines_around_parameters = true | ||
ij_php_space_after_type_cast = true | ||
ij_php_space_before_short_closure_left_parenthesis = true | ||
|
||
[{*.ant,*.fxml,*.jhm,*.jnlp,*.jrxml,*.pom,*.rng,*.tld,*.wadl,*.wsdl,*.xml,*.xsd,*.xsl,*.xslt,*.xul,phpunit.xml.dist}] | ||
ij_xml_space_inside_empty_tag = true | ||
|
||
[{*.tf,*.tfvars,*.hcl}] | ||
tab_width = 2 | ||
ij_continuation_indent_size = 4 | ||
|
||
[*.less] | ||
tab_width = 2 | ||
ij_continuation_indent_size = 2 | ||
|
||
[*.sass] | ||
tab_width = 2 | ||
ij_continuation_indent_size = 2 | ||
|
||
[*.scala] | ||
ij_scala_do_while_brace_force = always | ||
ij_scala_for_brace_force = always | ||
ij_scala_if_brace_force = always | ||
ij_scala_keep_blank_lines_before_right_brace = 0 | ||
ij_scala_keep_blank_lines_in_code = 0 | ||
ij_scala_keep_blank_lines_in_declarations = 0 | ||
ij_scala_multiline_string_closing_quotes_on_new_line = false | ||
|
||
[*.scss] | ||
ij_continuation_indent_size = 4 | ||
|
||
[{*.yaml,*.yml}] | ||
ij_yaml_spaces_within_braces = false | ||
ij_yaml_spaces_within_brackets = false |
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,105 @@ | ||
package resources | ||
|
||
import ( | ||
"github.com/aws/aws-sdk-go/aws" | ||
"github.com/aws/aws-sdk-go/aws/session" | ||
"github.com/aws/aws-sdk-go/service/bedrockagent" | ||
"github.com/rebuy-de/aws-nuke/v2/pkg/types" | ||
) | ||
|
||
type BedrockAgentAlias struct { | ||
svc *bedrockagent.BedrockAgent | ||
AgentId *string | ||
AgentAliasId *string | ||
AgentAliasName *string | ||
} | ||
|
||
func init() { | ||
register("BedrockAgentAlias", ListBedrockAgentAliases) | ||
} | ||
|
||
func ListBedrockAgentAliases(sess *session.Session) ([]Resource, error) { | ||
svc := bedrockagent.New(sess) | ||
resources := []Resource{} | ||
|
||
agentIds, err := ListBedrockAgentIds(svc) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
for _, agentId := range agentIds { | ||
params := &bedrockagent.ListAgentAliasesInput{ | ||
MaxResults: aws.Int64(100), | ||
AgentId: aws.String(agentId), | ||
} | ||
for { | ||
output, err := svc.ListAgentAliases(params) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
for _, agentAliasInfo := range output.AgentAliasSummaries { | ||
resources = append(resources, &BedrockAgentAlias{ | ||
svc: svc, | ||
AgentId: aws.String(agentId), | ||
AgentAliasName: agentAliasInfo.AgentAliasName, | ||
AgentAliasId: agentAliasInfo.AgentAliasId, | ||
}) | ||
} | ||
|
||
if output.NextToken == nil { | ||
break | ||
} | ||
params.NextToken = output.NextToken | ||
} | ||
|
||
} | ||
|
||
return resources, nil | ||
} | ||
|
||
func ListBedrockAgentIds(svc *bedrockagent.BedrockAgent) ([]string, error) { | ||
|
||
agentIds := []string{} | ||
params := &bedrockagent.ListAgentsInput{ | ||
MaxResults: aws.Int64(100), | ||
} | ||
for { | ||
output, err := svc.ListAgents(params) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
for _, agent := range output.AgentSummaries { | ||
agentIds = append(agentIds, *agent.AgentId) | ||
} | ||
|
||
if output.NextToken == nil { | ||
break | ||
} | ||
params.NextToken = output.NextToken | ||
} | ||
|
||
return agentIds, nil | ||
} | ||
|
||
func (f *BedrockAgentAlias) Remove() error { | ||
_, err := f.svc.DeleteAgentAlias(&bedrockagent.DeleteAgentAliasInput{ | ||
AgentAliasId: f.AgentAliasId, | ||
AgentId: f.AgentId, | ||
}) | ||
return err | ||
} | ||
|
||
func (f *BedrockAgentAlias) Properties() types.Properties { | ||
properties := types.NewProperties(). | ||
Set("AgentId", f.AgentId). | ||
Set("AgentAliasId", f.AgentAliasId). | ||
Set("AgentAliasName", f.AgentAliasName) | ||
|
||
return properties | ||
} | ||
|
||
func (f *BedrockAgentAlias) String() string { | ||
return *f.AgentAliasName | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@corybekk I think we should probably address these editorconfig and go changes via a separate PR from main to oreilly-main. @sstoops what are your thoughts here? How were you rolling these changes in before?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly, I think you've hacked on aws nuke more than I have at this point! It does look like the result of
main
not having been merged over tooreilly-main
first. I'm not sure it's a big deal (especially given our entire uncertain future with aws nuke).