Skip to content
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

service: add billing service to aws provider #41000

Merged
merged 14 commits into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 61 additions & 48 deletions .ci/.semgrep-service-name0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1938,6 +1938,67 @@ rules:
patterns:
- pattern-regex: "(?i)BedrockAgent"
severity: WARNING
- id: billing-in-func-name
languages:
- go
message: Do not use "Billing" in func name inside billing package
paths:
include:
- internal/service/billing
exclude:
- internal/service/billing/list_pages_gen.go
patterns:
- pattern: func $NAME( ... )
- metavariable-pattern:
metavariable: $NAME
patterns:
- pattern-regex: "(?i)Billing"
- focus-metavariable: $NAME
- pattern-not: func $NAME($T *testing.T)
severity: WARNING
- id: billing-in-test-name
languages:
- go
message: Include "Billing" in test name
paths:
include:
- internal/service/billing/*_test.go
patterns:
- pattern: func $NAME( ... )
- metavariable-pattern:
metavariable: $NAME
patterns:
- pattern-not-regex: "^TestAccBilling"
- pattern-regex: ^TestAcc.*
severity: WARNING
- id: billing-in-const-name
languages:
- go
message: Do not use "Billing" in const name inside billing package
paths:
include:
- internal/service/billing
patterns:
- pattern: const $NAME = ...
- metavariable-pattern:
metavariable: $NAME
patterns:
- pattern-regex: "(?i)Billing"
severity: WARNING
- id: billing-in-var-name
languages:
- go
message: Do not use "Billing" in var name inside billing package
paths:
include:
- internal/service/billing
patterns:
- pattern: var $NAME = ...
- metavariable-pattern:
metavariable: $NAME
patterns:
- pattern-regex: "(?i)Billing"
severity: WARNING
- id: budgets-in-func-name
languages:
- go
Expand Down Expand Up @@ -4330,51 +4391,3 @@ rules:
- pattern-not-regex: "^TestAccConnect"
- pattern-regex: ^TestAcc.*
severity: WARNING
- id: connect-in-const-name
languages:
- go
message: Do not use "Connect" in const name inside connect package
paths:
include:
- internal/service/connect
patterns:
- pattern: const $NAME = ...
- metavariable-pattern:
metavariable: $NAME
patterns:
- pattern-regex: "(?i)Connect"
- pattern-not-regex: .*uickConnect.*
severity: WARNING
- id: connect-in-var-name
languages:
- go
message: Do not use "Connect" in var name inside connect package
paths:
include:
- internal/service/connect
patterns:
- pattern: var $NAME = ...
- metavariable-pattern:
metavariable: $NAME
patterns:
- pattern-regex: "(?i)Connect"
- pattern-not-regex: .*uickConnect.*
severity: WARNING
- id: connectcases-in-func-name
languages:
- go
message: Do not use "ConnectCases" in func name inside connectcases package
paths:
include:
- internal/service/connectcases
exclude:
- internal/service/connectcases/list_pages_gen.go
patterns:
- pattern: func $NAME( ... )
- metavariable-pattern:
metavariable: $NAME
patterns:
- pattern-regex: "(?i)ConnectCases"
- focus-metavariable: $NAME
- pattern-not: func $NAME($T *testing.T)
severity: WARNING
77 changes: 48 additions & 29 deletions .ci/.semgrep-service-name1.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,53 @@
# Generated by internal/generate/servicesemgrep/main.go; DO NOT EDIT.
rules:
- id: connect-in-const-name
languages:
- go
message: Do not use "Connect" in const name inside connect package
paths:
include:
- internal/service/connect
patterns:
- pattern: const $NAME = ...
- metavariable-pattern:
metavariable: $NAME
patterns:
- pattern-regex: "(?i)Connect"
- pattern-not-regex: .*uickConnect.*
severity: WARNING
- id: connect-in-var-name
languages:
- go
message: Do not use "Connect" in var name inside connect package
paths:
include:
- internal/service/connect
patterns:
- pattern: var $NAME = ...
- metavariable-pattern:
metavariable: $NAME
patterns:
- pattern-regex: "(?i)Connect"
- pattern-not-regex: .*uickConnect.*
severity: WARNING
- id: connectcases-in-func-name
languages:
- go
message: Do not use "ConnectCases" in func name inside connectcases package
paths:
include:
- internal/service/connectcases
exclude:
- internal/service/connectcases/list_pages_gen.go
patterns:
- pattern: func $NAME( ... )
- metavariable-pattern:
metavariable: $NAME
patterns:
- pattern-regex: "(?i)ConnectCases"
- focus-metavariable: $NAME
- pattern-not: func $NAME($T *testing.T)
severity: WARNING
- id: connectcases-in-test-name
languages:
- go
Expand Down Expand Up @@ -4335,32 +4383,3 @@ rules:
- focus-metavariable: $NAME
- pattern-not: func $NAME($T *testing.T)
severity: WARNING
- id: iotevents-in-test-name
languages:
- go
message: Include "IoTEvents" in test name
paths:
include:
- internal/service/iotevents/*_test.go
patterns:
- pattern: func $NAME( ... )
- metavariable-pattern:
metavariable: $NAME
patterns:
- pattern-not-regex: "^TestAccIoTEvents"
- pattern-regex: ^TestAcc.*
severity: WARNING
- id: iotevents-in-const-name
languages:
- go
message: Do not use "IoTEvents" in const name inside iotevents package
paths:
include:
- internal/service/iotevents
patterns:
- pattern: const $NAME = ...
- metavariable-pattern:
metavariable: $NAME
patterns:
- pattern-regex: "(?i)IoTEvents"
severity: WARNING
43 changes: 29 additions & 14 deletions .ci/.semgrep-service-name2.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,34 @@
# Generated by internal/generate/servicesemgrep/main.go; DO NOT EDIT.
rules:
- id: iotevents-in-test-name
languages:
- go
message: Include "IoTEvents" in test name
paths:
include:
- internal/service/iotevents/*_test.go
patterns:
- pattern: func $NAME( ... )
- metavariable-pattern:
metavariable: $NAME
patterns:
- pattern-not-regex: "^TestAccIoTEvents"
- pattern-regex: ^TestAcc.*
severity: WARNING
- id: iotevents-in-const-name
languages:
- go
message: Do not use "IoTEvents" in const name inside iotevents package
paths:
include:
- internal/service/iotevents
patterns:
- pattern: const $NAME = ...
- metavariable-pattern:
metavariable: $NAME
patterns:
- pattern-regex: "(?i)IoTEvents"
severity: WARNING
- id: iotevents-in-var-name
languages:
- go
Expand Down Expand Up @@ -4355,17 +4384,3 @@ rules:
patterns:
- pattern-regex: "(?i)RedshiftData"
severity: WARNING
- id: redshiftdata-in-var-name
languages:
- go
message: Do not use "RedshiftData" in var name inside redshiftdata package
paths:
include:
- internal/service/redshiftdata
patterns:
- pattern: var $NAME = ...
- metavariable-pattern:
metavariable: $NAME
patterns:
- pattern-regex: "(?i)RedshiftData"
severity: WARNING
14 changes: 14 additions & 0 deletions .ci/.semgrep-service-name3.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Generated by internal/generate/servicesemgrep/main.go; DO NOT EDIT.
rules:
- id: redshiftdata-in-var-name
languages:
- go
message: Do not use "RedshiftData" in var name inside redshiftdata package
paths:
include:
- internal/service/redshiftdata
patterns:
- pattern: var $NAME = ...
- metavariable-pattern:
metavariable: $NAME
patterns:
- pattern-regex: "(?i)RedshiftData"
severity: WARNING
- id: redshiftdataapiservice-in-func-name
languages:
- go
Expand Down
2 changes: 2 additions & 0 deletions .github/labeler-issue-triage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ service/bedrock:
- '((\*|-)\s*`?|(data|resource)\s+"?)aws_bedrock_'
service/bedrockagent:
- '((\*|-)\s*`?|(data|resource)\s+"?)aws_bedrockagent_'
service/billing:
- '((\*|-)\s*`?|(data|resource)\s+"?)aws_billing_'
service/billingconductor:
- '((\*|-)\s*`?|(data|resource)\s+"?)aws_billingconductor_'
service/braket:
Expand Down
6 changes: 6 additions & 0 deletions .github/labeler-pr-triage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,12 @@ service/bedrockagent:
- any-glob-to-any-file:
- 'internal/service/bedrockagent/**/*'
- 'website/**/bedrockagent_*'
service/billing:
- any:
- changed-files:
- any-glob-to-any-file:
- 'internal/service/billing/**/*'
- 'website/**/billing_*'
service/billingconductor:
- any:
- changed-files:
Expand Down
1 change: 1 addition & 0 deletions .teamcity/components/generated/services_all.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ val services = mapOf(
"bcmdataexports" to ServiceSpec("BCM Data Exports", parallelismOverride = 5),
"bedrock" to ServiceSpec("Bedrock"),
"bedrockagent" to ServiceSpec("Bedrock Agents"),
"billing" to ServiceSpec("Billing"),
"budgets" to ServiceSpec("Web Services Budgets"),
"ce" to ServiceSpec("CE (Cost Explorer)"),
"chatbot" to ServiceSpec("Chatbot"),
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ require (
github.com/aws/aws-sdk-go-v2/service/bcmdataexports v1.7.10
github.com/aws/aws-sdk-go-v2/service/bedrock v1.26.1
github.com/aws/aws-sdk-go-v2/service/bedrockagent v1.33.2
github.com/aws/aws-sdk-go-v2/service/billing v1.1.3
github.com/aws/aws-sdk-go-v2/service/budgets v1.29.4
github.com/aws/aws-sdk-go-v2/service/chatbot v1.9.4
github.com/aws/aws-sdk-go-v2/service/chime v1.34.10
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ github.com/aws/aws-sdk-go-v2/service/bedrock v1.26.1 h1:drWmTZL9Aa9NEfcxwgpUFnGH
github.com/aws/aws-sdk-go-v2/service/bedrock v1.26.1/go.mod h1:NHxAOlUfU3qQYd5Izu2i2sTASSIE2eJmkSyTT+ID3Q4=
github.com/aws/aws-sdk-go-v2/service/bedrockagent v1.33.2 h1:MIq/krL97NVByNbF+2xfpP8wVpPWLRG8Jsz6jHpJU8w=
github.com/aws/aws-sdk-go-v2/service/bedrockagent v1.33.2/go.mod h1:AMXD4amvPmC932TCKBF4kKfY9GIEG1XwS0K+gKcEYp4=
github.com/aws/aws-sdk-go-v2/service/billing v1.1.3 h1:dR3MLrnqgMgtOIkal5ty2i9Gh3Gc1Nl43t3qY+Hou68=
github.com/aws/aws-sdk-go-v2/service/billing v1.1.3/go.mod h1:VJvu5Kjq4s1kBPgohaYUXve0Hyz+oJ1ZGpYmuaW7oWw=
github.com/aws/aws-sdk-go-v2/service/budgets v1.29.4 h1:4wky3MXaaLbSpVMN8NZaNwoETIW678aQG+VC7oeCbTg=
github.com/aws/aws-sdk-go-v2/service/budgets v1.29.4/go.mod h1:3MbN92PIKD3YuL3dORwoC6GHPISYy5nh/EnwiSSp7XU=
github.com/aws/aws-sdk-go-v2/service/chatbot v1.9.4 h1:4UnbZyLM53KlJROIdUN1H2PJmU3cB52u9mrgkuyhmHI=
Expand Down
1 change: 1 addition & 0 deletions infrastructure/repository/labels-service.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ variable "service_labels" {
"bcmdataexports",
"bedrock",
"bedrockagent",
"billing",
"billingconductor",
"braket",
"budgets",
Expand Down
2 changes: 2 additions & 0 deletions internal/provider/service_packages_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package meta
package billing

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package meta_test
package billing_test

import (
"testing"
Expand All @@ -12,7 +12,7 @@ import (
"github.com/hashicorp/terraform-provider-aws/names"
)

func TestAccMetaBillingServiceAccountDataSource_basic(t *testing.T) {
func TestAccBillingServiceAccountDataSource_basic(t *testing.T) {
ctx := acctest.Context(t)
dataSourceName := "data.aws_billing_service_account.test"
billingAccountID := "386209384616"
Expand All @@ -23,7 +23,7 @@ func TestAccMetaBillingServiceAccountDataSource_basic(t *testing.T) {
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories,
Steps: []resource.TestStep{
{
Config: testAccBillingServiceAccountDataSourceConfig_basic,
Config: testAccServiceAccountDataSourceConfig_basic,
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr(dataSourceName, names.AttrID, billingAccountID),
acctest.CheckResourceAttrGlobalARNAccountID(dataSourceName, names.AttrARN, billingAccountID, "iam", "root"),
Expand All @@ -33,6 +33,6 @@ func TestAccMetaBillingServiceAccountDataSource_basic(t *testing.T) {
})
}

const testAccBillingServiceAccountDataSourceConfig_basic = `
const testAccServiceAccountDataSourceConfig_basic = `
data "aws_billing_service_account" "test" {}
`
Loading
Loading