@@ -1133,6 +1133,16 @@ func TestDiagnosticHelpers(t *testing.T) {
11331133 }
11341134 })
11351135
1136+ t .Run ("rejects non https configured endpoint schemes" , func (t * testing.T ) {
1137+ _ , _ , err := awsDiagnosticEndpointsForCheck ("aws.backup-vault" , nil , []string {"http://vpce-123.backup.eu-west-1.vpce.amazonaws.com:80" })
1138+ if err == nil {
1139+ t .Fatalf ("expected unsupported endpoint scheme error" )
1140+ }
1141+ if ! strings .Contains (err .Error (), "only https endpoints are supported" ) {
1142+ t .Fatalf ("expected unsupported scheme detail, got %v" , err )
1143+ }
1144+ })
1145+
11361146 t .Run ("tls probe returns immediately when context is canceled" , func (t * testing.T ) {
11371147 ctx , cancel := context .WithCancel (context .Background ())
11381148 cancel ()
@@ -1752,6 +1762,46 @@ func TestAWSResourceExplorerURL(t *testing.T) {
17521762 want : "https://console.aws.amazon.com/resource-explorer/home?region=us-east-1#/search?query=id%3Aarn%3Aaws%3As3%3A%3A%3Aexample-bucket" ,
17531763 wantLink : true ,
17541764 },
1765+ {
1766+ name : "s3 bucket in china region uses aws cn partition" ,
1767+ payload : & StandardizedResourcePayload {
1768+ Resource : StandardizedResourceInfo {
1769+ ID : "example-bucket" ,
1770+ Type : "aws.s3" ,
1771+ Provider : "aws" ,
1772+ Region : "cn-north-1" ,
1773+ },
1774+ },
1775+ want : "https://console.aws.amazon.com/resource-explorer/home?region=cn-north-1#/search?query=id%3Aarn%3Aaws-cn%3As3%3A%3A%3Aexample-bucket" ,
1776+ wantLink : true ,
1777+ },
1778+ {
1779+ name : "s3 bucket in gov region uses aws us gov partition" ,
1780+ payload : & StandardizedResourcePayload {
1781+ Resource : StandardizedResourceInfo {
1782+ ID : "example-bucket" ,
1783+ Type : "aws.s3" ,
1784+ Provider : "aws" ,
1785+ Region : "us-gov-west-1" ,
1786+ },
1787+ },
1788+ want : "https://console.aws.amazon.com/resource-explorer/home?region=us-gov-west-1#/search?query=id%3Aarn%3Aaws-us-gov%3As3%3A%3A%3Aexample-bucket" ,
1789+ wantLink : true ,
1790+ },
1791+ {
1792+ name : "s3 bucket uses account id arn partition hint" ,
1793+ payload : & StandardizedResourcePayload {
1794+ Resource : StandardizedResourceInfo {
1795+ ID : "example-bucket" ,
1796+ Type : "aws.s3" ,
1797+ Provider : "aws" ,
1798+ AccountID : "arn:aws-us-gov:iam::123456789012:root" ,
1799+ Region : "us-east-1" ,
1800+ },
1801+ },
1802+ want : "https://console.aws.amazon.com/resource-explorer/home?region=us-east-1#/search?query=id%3Aarn%3Aaws-us-gov%3As3%3A%3A%3Aexample-bucket" ,
1803+ wantLink : true ,
1804+ },
17551805 {
17561806 name : "non arn non s3 resource id has no resource explorer link" ,
17571807 payload : & StandardizedResourcePayload {
0 commit comments