Skip to content

Commit f88fad9

Browse files
fix[backend](integrations): removed aws log group in aws integrations module
1 parent 8c4278d commit f88fad9

2 files changed

Lines changed: 1 addition & 20 deletions

File tree

backend/modules/integrations/repository/schema_provider.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ var moduleSchemas = map[string]map[string]string{
1212
"aws_access_key_id": "text",
1313
"aws_secret_access_key": "password",
1414
"aws_default_region": "text",
15-
"aws_log_group_name": "text",
1615
},
1716
"AZURE": {
1817
"eventHubConnection": "password", // connection string contains SharedAccessKey

backend/modules/integrations/verifier/verifier_aws.go

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88

99
awsconfig "github.com/aws/aws-sdk-go-v2/config"
1010
"github.com/aws/aws-sdk-go-v2/credentials"
11-
"github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs"
1211
"github.com/aws/aws-sdk-go-v2/service/sts"
1312
)
1413

@@ -18,15 +17,13 @@ func verifyAWSIAMUser(c map[string]string) error {
1817
"aws_default_region",
1918
"aws_access_key_id",
2019
"aws_secret_access_key",
21-
"aws_log_group_name",
2220
); err != nil {
2321
return err
2422
}
2523

2624
regionName := c["aws_default_region"]
2725
accessKey := c["aws_access_key_id"]
2826
secretAccessKey := c["aws_secret_access_key"]
29-
logGroup := c["aws_log_group_name"]
3027

3128
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
3229
defer cancel()
@@ -59,20 +56,5 @@ func verifyAWSIAMUser(c map[string]string) error {
5956
return fmt.Errorf("AWS credentials are invalid. Please verify your Access Key and Secret Key are correct.")
6057
}
6158

62-
cwlClient := cloudwatchlogs.NewFromConfig(cfg)
63-
out, err := cwlClient.DescribeLogGroups(ctx, &cloudwatchlogs.DescribeLogGroupsInput{LogGroupNamePrefix: &logGroup})
64-
if err != nil {
65-
errMsg := strings.ToLower(err.Error())
66-
if strings.Contains(errMsg, "accessdenied") || strings.Contains(errMsg, "not authorized") {
67-
return fmt.Errorf("AWS credentials do not have permission to access CloudWatch in region '%s'. Please verify your IAM permissions.", regionName)
68-
}
69-
return fmt.Errorf("Cannot access CloudWatch Log Groups in region '%s'. Please verify the region and your IAM permissions.", regionName)
70-
}
71-
72-
for _, lg := range out.LogGroups {
73-
if lg.LogGroupName != nil && *lg.LogGroupName == logGroup {
74-
return nil
75-
}
76-
}
77-
return fmt.Errorf("The CloudWatch Log Group '%s' was not found in region '%s'. Please verify the Log Group name and region.", logGroup, regionName)
59+
return nil
7860
}

0 commit comments

Comments
 (0)