Skip to content

Commit

Permalink
Address CI linting, semgrep concerns
Browse files Browse the repository at this point in the history
  • Loading branch information
djsd123 committed Jan 29, 2025
1 parent 6fdc6bc commit 37deeb0
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 29 deletions.
6 changes: 3 additions & 3 deletions internal/service/fis/experiment_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ func resourceExperimentTemplate() *schema.Resource {
"dashboard_arn": {
Type: schema.TypeString,
Optional: true,
ValidateFunc: validation.StringMatch(regexache.MustCompile(`^arn:aws:cloudwatch::\d{12}:dashboard\/[a-zA-Z0-9_-]+$`), "must be in the format of arn:aws:cloudwatch::account-id:dashboard/dashboard-name"),
ValidateFunc: verify.ValidARN,
},
},
},
Expand Down Expand Up @@ -1151,8 +1151,8 @@ func flattenExperimentTemplateExperimentReportConfigurationS3Configuration(confi

dataResources := make([]map[string]interface{}, 1)
dataResources[0] = make(map[string]interface{})
dataResources[0]["bucket_name"] = aws.ToString(configured.BucketName)
dataResources[0]["prefix"] = aws.ToString(configured.Prefix)
dataResources[0][names.AttrBucketName] = aws.ToString(configured.BucketName)
dataResources[0][names.AttrPrefix] = aws.ToString(configured.Prefix)

return dataResources
}
Expand Down
12 changes: 0 additions & 12 deletions internal/service/fis/experiment_template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1270,12 +1270,6 @@ data "aws_iam_policy_document" "report_access" {
}
}
resource "aws_iam_role_policy_attachment" "fis_access" {
role = aws_iam_role.test.name
policy_arn = "arn:aws:iam::aws:policy/service-role/AWSFaultInjectionSimulatorEC2Access"
}
resource "aws_iam_policy" "report_access" {
name = "report_access"
policy = data.aws_iam_policy_document.report_access.json
Expand Down Expand Up @@ -1416,12 +1410,6 @@ data "aws_iam_policy_document" "report_access" {
}
}
resource "aws_iam_role_policy_attachment" "fis_access" {
role = aws_iam_role.test.name
policy_arn = "arn:aws:iam::aws:policy/service-role/AWSFaultInjectionSimulatorEC2Access"
}
resource "aws_iam_policy" "report_access" {
name = "report_access"
policy = data.aws_iam_policy_document.report_access.json
Expand Down
28 changes: 14 additions & 14 deletions website/docs/r/fis_experiment_template.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -73,41 +73,41 @@ data "aws_iam_policy_document" "report_access" {
version = "2012-10-17"
statement {
sid = "logsDelivery"
effect = "Allow"
actions = ["logs:CreateLogDelivery"]
sid = "logsDelivery"
effect = "Allow"
actions = ["logs:CreateLogDelivery"]
resources = ["*"]
}
statement {
sid = "ReportsBucket"
effect = "Allow"
actions = ["s3:PutObject", "s3:GetObject"]
sid = "ReportsBucket"
effect = "Allow"
actions = ["s3:PutObject", "s3:GetObject"]
resources = ["*"]
}
statement {
sid = "GetDashboard"
effect = "Allow"
actions = ["cloudwatch:GetDashboard"]
sid = "GetDashboard"
effect = "Allow"
actions = ["cloudwatch:GetDashboard"]
resources = ["*"]
}
statement {
sid = "GetDashboardData"
effect = "Allow"
actions = ["cloudwatch:getMetricWidgetImage"]
sid = "GetDashboardData"
effect = "Allow"
actions = ["cloudwatch:getMetricWidgetImage"]
resources = ["*"]
}
}
resource "aws_iam_policy" "report_access" {
name = "report_access"
name = "report_access"
policy = data.aws_iam_policy_document.report_access.json
}
resource "aws_iam_role_policy_attachment" "report_access" {
role = aws_iam_role.test.name
role = aws_iam_role.test.name
policy_arn = aws_iam_policy.report_access.arn
}
Expand Down

0 comments on commit 37deeb0

Please sign in to comment.