Skip to content

Commit

Permalink
Merge branch 'main' into bedrock_updates
Browse files Browse the repository at this point in the history
  • Loading branch information
brmur authored Oct 30, 2023
2 parents 4d1de62 + 99651ab commit 7aad65e
Show file tree
Hide file tree
Showing 225 changed files with 1,195 additions and 759 deletions.
1 change: 1 addition & 0 deletions .doc_gen/metadata/cross_metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ cross_FSA:
.NET:
versions:
- sdk_version: 3
github: dotnetv3/cross-service/FeedbackSentimentAnalyzer
block_content: cross_FSA_NetV3_block.xml
Java:
versions:
Expand Down
66 changes: 0 additions & 66 deletions .github/linters/.editorconfig

This file was deleted.

34 changes: 34 additions & 0 deletions .github/workflows/dotnet-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Dotnet lint check
on:
push:
paths:
- "dotnetv3/**"
branches:
- main
pull_request:
paths:
- "dotnetv3/**"
workflow_dispatch:
permissions:
contents: read
jobs:
dotnetcheck:
runs-on: ubuntu-latest
steps:
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
5.0.x
6.0.x
- name: Checkout files
uses: actions/checkout@v3
- name: Build check
run: |
cd dotnetv3
dotnet build -v=q --property WarningLevel=0 /clp:ErrorsOnly
- name: Lint and format check
if: success() || failure()
run: |
cd dotnetv3
dotnet format --verify-no-changes
1 change: 0 additions & 1 deletion .github/workflows/super-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,5 @@ jobs:
VALIDATE_PYTHON: true
VALIDATE_PYTHON_BLACK: true
VALIDATE_RUBY: true
VALIDATE_CSHARP: true
VALIDATE_KOTLIN: true
VALIDATE_EDITORCONFIG: true
44 changes: 44 additions & 0 deletions .tools/test/SPECIFICATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Deployment Instructions
These instructions assume a "target account" (where tests will be invoked) of "python" per [this repository's configuration](config/targets.yaml).
You can replace Python with any of the other languages listed in this repository's configuration.

To request an alternate configuration for your own repository, please [submit an issue](https://github.com/awsdocs/aws-doc-sdk-examples/issues/new?labels=type%2Fenhancement&labels=Tools&title=%5BEnhancement%5D%3A+Weathertop+Customization+Request&&) with the `Tools` label.

## 1. Deploy Consumer Stack for your language (e.g. Python)
Admin will:
1. Set Python virtualenv within [sqs_lambda_to_batch_fargate directory](sqs_lambda_to_batch_fargate).
1. `export LANAUGE_NAME=python`.
1. Get Python account tokens.
2. `cdk bootstrap` and `cdk deploy`.

## 2. Enable Consumer Stack to receive event notifications
User will:
1. Set `status` to `enabled` in [targets.yaml](config/targets.yaml) for your language
1. Raise PR.

Admin will:
1. Approve and merge PR.
1. Set Python virtualenv within [eventbridge_rule_with_sns_fanout directory](eventbridge_rule_with_sns_fanout).
1. Get Admin account tokens.
1. `cdk bootstrap` and `cdk deploy`.
1. Request user [submit test job](#3-submit-test-job).

## 3. Submit test job
User will:
1. Log into console for Python account
1. Navigate to "Job Definitions".
![](docs/validation-flow-1.jpg)
1. Click "Submit Job".
![](docs/validation-flow-2.jpg)
1. Add name, select queue, and click "Next".
![](docs/validation-flow-3.jpg)
1. Click "Next".
![](docs/validation-flow-4.jpg)
1. Click "Create job".
![](docs/validation-flow-5.jpg)
1. [Validate results of test job](#3-optional-view-test-job-results)

## 3. Optional: View CloudWatch job results in Batch
1. Navigate to a job
1. When status is `SUCCEEDED` or `FAILED`, click "Logging" tab.
![](docs/validation-flow-6.jpg)
18 changes: 9 additions & 9 deletions .tools/test/config/targets.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
cpp:
account_id: "770244195820"
status: "disabled"
status: "enabled"
dotnetv3:
account_id: "441997275833"
status: "disabled"
status: "enabled"
gov2:
account_id: "234521034040"
status: "disabled"
status: "enabled"
javascriptv3:
account_id: "875008041426"
status: "disabled"
status: "enabled"
javav2:
account_id: "814548047983" # back-up "667348412466"
status: "disabled"
Expand All @@ -18,19 +18,19 @@ kotlin:
status: "disabled"
php:
account_id: "733931915187"
status: "disabled"
status: "enabled"
python:
account_id: "664857444588"
status: "disabled"
status: "enabled"
ruby:
account_id: "616362385685"
status: "disabled"
status: "enabled"
rust_dev_preview:
account_id: "050288538048"
status: "disabled"
status: "enabled"
sap-abap:
account_id: "099736152523"
status: "disabled"
swift:
account_id: "637397754108"
status: "disabled"
status: "enabled"
Binary file added .tools/test/docs/validation-flow-1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .tools/test/docs/validation-flow-2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .tools/test/docs/validation-flow-3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .tools/test/docs/validation-flow-4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .tools/test/docs/validation-flow-5.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .tools/test/docs/validation-flow-6.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
108 changes: 97 additions & 11 deletions dotnetv3/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,86 @@ root = true

# C# files
[*.cs]
# Organize usings
dotnet_sort_system_directives_first = true
# this. preferences
dotnet_style_qualification_for_field = false:silent
dotnet_style_qualification_for_property = false:silent
dotnet_style_qualification_for_method = false:silent
dotnet_style_qualification_for_event = false:silent
# Language keywords vs BCL types preferences
dotnet_style_predefined_type_for_locals_parameters_members = true:silent
dotnet_style_predefined_type_for_member_access = true:silent
# Parentheses preferences
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
# Modifier preferences
dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent
dotnet_style_readonly_field = true:suggestion
# Expression-level preferences
dotnet_style_object_initializer = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_explicit_tuple_names = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:silent
dotnet_style_prefer_inferred_tuple_names = true:suggestion
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
dotnet_style_prefer_auto_properties = true:silent
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
dotnet_style_prefer_conditional_expression_over_return = true:silent

###############################
# Naming Conventions #
###############################
# Style Definitions
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
# Use PascalCase for constant fields
dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
dotnet_naming_symbols.constant_fields.applicable_kinds = field
dotnet_naming_symbols.constant_fields.applicable_accessibilities = *
dotnet_naming_symbols.constant_fields.required_modifiers = const

###############################
# C# Coding Conventions #
###############################
# var preferences
csharp_style_var_for_built_in_types = true:silent
csharp_style_var_when_type_is_apparent = true:silent
csharp_style_var_elsewhere = true:silent
# Expression-bodied members
csharp_style_expression_bodied_methods = false:silent
csharp_style_expression_bodied_constructors = false:silent
csharp_style_expression_bodied_operators = false:silent
csharp_style_expression_bodied_properties = true:silent
csharp_style_expression_bodied_indexers = true:silent
csharp_style_expression_bodied_accessors = true:silent
# Pattern matching preferences
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
# Null-checking preferences
csharp_style_throw_expression = true:suggestion
csharp_style_conditional_delegate_call = true:suggestion
# Modifier preferences
csharp_preferred_modifier_order = public,private,protected,internal,file,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,required,volatile,async:suggestion
# Expression-level preferences
csharp_prefer_braces = true:silent
csharp_style_deconstructed_variable_declaration = true:suggestion
csharp_prefer_simple_default_expression = true:suggestion
csharp_style_prefer_local_over_anonymous_function = true:suggestion
csharp_style_inlined_variable_declaration = true:suggestion

###############################
# C# Formatting Rules #
###############################
insert_final_newline = false
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
file_header_template = Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. \nSPDX-License-Identifier: Apache-2.0

# New line preferences
csharp_new_line_before_open_brace = all
csharp_new_line_before_else = true
Expand All @@ -19,18 +93,13 @@ csharp_new_line_before_finally = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_members_in_anonymous_types = true
csharp_new_line_between_query_expression_clauses = true

# Indentation preferences
csharp_indent_block_contents = true
csharp_indent_braces = false
csharp_indent_case_contents = true
csharp_indent_case_contents_when_block = true
csharp_indent_switch_labels = true
csharp_indent_labels = one_less_than_current

# Code style defaults
dotnet_sort_system_directives_first = true

# Space preferences
csharp_space_after_cast = false
csharp_space_after_colon_in_inheritance_clause = true
Expand All @@ -55,13 +124,30 @@ csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_parentheses = false
csharp_space_between_square_brackets = false

###############################
# Custom Rules #
###############################
# File header.
file_header_template = Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. \nSPDX-License-Identifier: Apache-2.0
# SA1600: Elements must be documented is disabled.
dotnet_diagnostic.SA1600.severity = none
dotnet_diagnostic.SA1615.severity = none
# SA1633: allow custom file header
dotnet_diagnostic.SA0001.severity = suggestion
dotnet_diagnostic.SA1200.severity = suggestion
# IDE0005 remove unused using statements.
dotnet_diagnostic.IDE0005.severity = error
# CS0168 do not allow unused variables.
dotnet_diagnostic.CS0168.severity = error
# CS8601: nullability warnings
dotnet_diagnostic.CS8601.severity = suggestion
dotnet_diagnostic.CS8604.severity = suggestion
# SA1633: allow custom file header.
dotnet_diagnostic.SA1633.severity = none
# SA1101: do not require keyword this
# SA1101: do not require keyword this.
dotnet_diagnostic.SA1101.severity = none

# IDE2000: Disallow multiple blank lines
# SA1309: allow underscores in field names.
dotnet_diagnostic.SA1309.severity = none
# IDE2000: Disallow multiple blank lines.
dotnet_diagnostic.IDE2000.severity = error
# IDE0073: Require a file header.
dotnet_diagnostic.IDE0073.severity = error
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ namespace DescribeCertificate
class DescribeCertificate
{
// The following example retrieves and displays the metadate for a
// certificate using the AWS Certificate Manager (ACM) service. It
// was created using AWS SDK for .NET 3.5 and .NET 5.0.
// certificate using the AWS Certificate Manager (ACM) service.

// Specify your AWS Region (an example Region is shown).
private static readonly RegionEndpoint ACMRegion = RegionEndpoint.USEast1;
Expand Down Expand Up @@ -76,11 +75,11 @@ static async Task<DescribeCertificateResponse> DescribeCertificateResponseAsync(
{
response = await client.DescribeCertificateAsync(request);
}
catch (InvalidArnException ex)
catch (InvalidArnException)
{
Console.WriteLine($"Error: The ARN specified is invalid.");
}
catch (ResourceNotFoundException ex)
catch (ResourceNotFoundException)
{
Console.WriteLine($"Error: The specified certificate could not be found.");
}
Expand Down
Loading

0 comments on commit 7aad65e

Please sign in to comment.