Skip to content

Commit 4a1c9f0

Browse files
authored
Merge pull request #143 from carapace-sh/fix-configservice
fix configservice
2 parents ea90ec7 + a60a8d5 commit 4a1c9f0

4 files changed

Lines changed: 68 additions & 1 deletion

File tree

cmd/carapace-aws/cmd/botocore/aws.configservice.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,6 +1093,8 @@ commands:
10931093
--cli-input-yaml=: Read arguments from the YAML string provided.
10941094
--generate-cli-skeleton: Prints a JSON skeleton to standard output without sending an API request.
10951095
--resource-evaluation-id=!: The unique `ResourceEvaluationId` of Amazon Web Services resource execution for which you want to retrieve the evaluation summary.
1096+
- name: get-status
1097+
description: Reports the status of all of configuration recorders and delivery channels
10961098
- name: get-stored-query
10971099
description: Returns the details of a specific stored query.
10981100
flags:
@@ -2117,6 +2119,7 @@ commands:
21172119
--cli-input-yaml=: Read arguments from the YAML string provided.
21182120
--configuration-recorder=!: An object for the configuration recorder.
21192121
--generate-cli-skeleton: Prints a JSON skeleton to standard output without sending an API request.
2122+
--recording-group=: Specifies which resource types are in scope for the configuration recorder to record
21202123
--tags=: The tags for the customer managed configuration recorder.
21212124
- name: put-conformance-pack
21222125
description: Creates or updates a conformance pack.
@@ -2303,6 +2306,12 @@ commands:
23032306
--cli-input-yaml=: Read arguments from the YAML string provided.
23042307
--configuration-recorder-name=!: The name of the customer managed configuration recorder that you want to stop.
23052308
--generate-cli-skeleton: Prints a JSON skeleton to standard output without sending an API request.
2309+
- name: subscribe
2310+
description: Subscribes user to AWS Config
2311+
flags:
2312+
--iam-role=!: The IAM role that the AWS Config configuration recorder will use
2313+
--s3-bucket=!: The S3 bucket that the AWS Config delivery channel will use
2314+
--sns-topic=!: The SNS topic that the AWS Config delivery channel will use
23062315
- name: tag-resource
23072316
description: Associates the specified tags to a resource with the specified `ResourceArn`.
23082317
flags:
Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,40 @@
11
package customizations
22

3-
import "github.com/carapace-sh/carapace-spec/pkg/command"
3+
import (
4+
_ "embed"
5+
6+
"github.com/carapace-sh/carapace-spec/pkg/command"
7+
"gopkg.in/yaml.v3"
8+
)
9+
10+
//go:embed configservice/aws.configservice.get-status.yaml
11+
var configservice_getStatus []byte
12+
13+
//go:embed configservice/aws.configservice.subscribe.yaml
14+
var configservice_subscribe []byte
415

516
func init() {
617
customizations["config"] = func(cmd *command.Command) error {
718
cmd.Name = "configservice"
19+
20+
for _, spec := range [][]byte{
21+
configservice_getStatus,
22+
configservice_subscribe,
23+
} {
24+
var specCommand command.Command
25+
if err := yaml.Unmarshal(spec, &specCommand); err != nil {
26+
return err
27+
}
28+
cmd.Commands = append(cmd.Commands, specCommand)
29+
}
30+
return nil
31+
}
32+
customizations["config.put-configuration-recorder"] = func(cmd *command.Command) error {
33+
cmd.AddFlag(command.Flag{
34+
Longhand: "recording-group",
35+
Description: "Specifies which resource types are in scope for the configuration recorder to record",
36+
Value: true,
37+
})
838
return nil
939
}
1040
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# yaml-language-server: $schema=https://carapace.sh/schemas/command.json
2+
name: get-status
3+
description: Reports the status of all of configuration recorders and delivery channels
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# yaml-language-server: $schema=https://carapace.sh/schemas/command.json
2+
name: subscribe
3+
description: Subscribes user to AWS Config
4+
flags:
5+
--s3-bucket=!: The S3 bucket that the AWS Config delivery channel will use
6+
--sns-topic=!: The SNS topic that the AWS Config delivery channel will use
7+
--iam-role=!: The IAM role that the AWS Config configuration recorder will use
8+
documentation:
9+
command: |
10+
Subscribes user to AWS Config by creating an AWS Config delivery channel
11+
and configuration recorder to track AWS resource configurations.
12+
The names of the default channel and configuration recorder will be default.
13+
flag:
14+
s3-bucket: |
15+
The S3 bucket that the AWS Config delivery channel will use.
16+
If the bucket does not exist, it will be automatically created.
17+
The value for this argument should follow the form bucket/prefix.
18+
Note that the prefix is optional.
19+
sns-topic: |
20+
The SNS topic that the AWS Config delivery channel will use.
21+
If the SNS topic does not exist, it will be automatically created.
22+
Value for this should be a valid SNS topic name or the ARN of an existing SNS topic.
23+
iam-role: |
24+
The IAM role that the AWS Config configuration recorder will use to record current resource configurations.
25+
Value for this should be the ARN of the desired IAM role.

0 commit comments

Comments
 (0)