Skip to content

Commit e3a54b6

Browse files
committed
Add dummy argument exclude_services to resource discovery
1 parent 0372e59 commit e3a54b6

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

main.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ func main() {
2323
var compartmentName = flag.String("compartment_name", "", "[export] The name of a compartment to export.")
2424
var outputPath = flag.String("output_path", "", "[export] Path to output generated configurations and state files of the exported compartment")
2525
var services = flag.String("services", "", "[export] Comma-separated list of service resources to export. By default, all compartment-scope resources are exported.")
26+
var excludeServices = flag.String("exclude_services", "", "[export] [experimental] Comma-separated list of service resources to exclude from export. If a service is present in both 'services' and 'exclude_services' argument, it will be excluded.")
2627
var ids = flag.String("ids", "", "[export] Comma-separated list of resource IDs to export. The ID could either be an OCID or a Terraform import ID. By default, all resources are exported.")
2728
var generateStateFile = flag.Bool("generate_state", false, "[export][experimental] Set this to import the discovered resources into a state file along with the Terraform configuration")
2829
var help = flag.Bool("help", false, "Prints usage options")
@@ -70,6 +71,10 @@ func main() {
7071
args.Services = strings.Split(*services, ",")
7172
}
7273

74+
if excludeServices != nil && *excludeServices != "" {
75+
args.ExcludeServices = strings.Split(*excludeServices, ",")
76+
}
77+
7378
if ids != nil && *ids != "" {
7479
args.IDs = strings.Split(*ids, ",")
7580
}

oci/export_compartment.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ type ExportCommandArgs struct {
128128
GenerateState bool
129129
TFVersion *TfHclVersion
130130
RetryTimeout *string
131+
ExcludeServices []string
131132
}
132133

133134
func RunExportCommand(args *ExportCommandArgs) (error, Status) {

0 commit comments

Comments
 (0)