aws_greengrass_nucleus/lib.rs
1#![allow(unused)]
2pub mod config;
3pub mod dependency;
4pub mod easysetup;
5pub mod mqtt;
6pub mod provisioning;
7pub mod util;
8
9pub mod services;
10
11// pub use self::easysetup::perform_setup;
12pub use self::mqtt::publish;
13pub use self::services::kernel::VERSION as ggcVersion;
14pub use self::services::status::upload_fss_data as fleet_status;
15
16use clap::Parser;
17
18#[derive(Parser, Debug)]
19#[clap(author, version, about, long_about = None)]
20pub struct Args {
21 // The AWS Region to use. The AWS IoT Greengrass Core software uses this Region
22 // to retrieve or create the AWS resources that it requires
23 #[clap(long, default_value = "ap-southeast-1")]
24 pub aws_region: String,
25
26 // (Optional) The path to the folder to use as the root for the AWS IoT Greengrass Core
27 // software.
28 #[clap(long, default_value = ".")]
29 pub root: std::path::PathBuf,
30
31 // (Optional) The path to the configuration file that you use to run the AWS
32 // IoT Greengrass Core software
33 #[clap(long, default_value = "config/config.yaml")]
34 pub init_config: std::path::PathBuf,
35
36 // (Optional) Specify true or false. If true, the AWS IoT Greengrass Core software registers this
37 // device as an AWS IoT thing, and provisions the AWS resources that the software requires. The
38 // software provisions an AWS IoT thing, (optional) an AWS IoT thing group, a Thing Policy, an
39 // IAM role, and an AWS IoT role alias. Defaults to false.
40 #[clap(long, action = clap::ArgAction::Set, default_value_t=false)]
41 pub provision: bool,
42
43 // The name of the AWS IoT thing that you register as this core device.
44 // If the thing with
45 // this name doesn't exist in your AWS account, the AWS IoT Greengrass Core software creates it.
46 // Defaults to GreengrassV2IotThing_ plus a random UUID.
47 #[clap(short, long, default_value = "GreengrassV2IotThing_random_uuid")]
48 pub thing_name: String,
49
50 // (Optional) The name of the AWS IoT thing group where you add this core
51 // device's AWS IoT thing.
52 // If a deployment targets this thing group, this core device receives that deployment when it
53 // connects to AWS IoT Greengrass. If the thing group with this name doesn't exist in your AWS
54 // account, the AWS IoT Greengrass Core software creates it. Defaults to no thing group.
55 #[clap(long)]
56 pub thing_group_name: Option<String>,
57
58 // (Optional) The name of the AWS IoT Policy to attach to the core device's
59 // AWS IoT thing.
60 // If specified, then the supplied thing_policy_name is attached to the provisioned IoT Thing.
61 // Otherwise a policy called GreengrassV2IoTThingPolicy is used instead. If the policy with
62 // this name doesn't exist in your AWS account, the AWS IoT Greengrass Core software creates it
63 // with a default policy document.
64 #[clap(long, default_value = "GreengrassV2IoTThingPolicy")]
65 pub thing_policy_name: String,
66
67 // (Optional) The name of the IAM role to use to acquire AWS credentials that let the device
68 // interact with AWS services. If the role with this name doesn't exist in your AWS account, " the AWS
69 // IoT Greengrass Core software creates it with the GreengrassV2TokenExchangeRoleAccess policy.
70 // This role doesn't have access to your S3 buckets where you host component artifacts. So, you
71 // must add permissions to your artifacts' S3 buckets and objects when you create a component.
72 // Defaults to GreengrassV2TokenExchangeRole.
73 #[clap(long, default_value = "GreengrassV2TokenExchangeRole")]
74 pub tes_role_name: String,
75
76 // (Optional) The name of the AWS IoT role alias that points to the IAM role that provides AWS
77 // credentials for this device. If the role alias with this name doesn't exist in your AWS "
78 // account, the
79 // AWS IoT Greengrass Core software creates it and points it to the IAM role that you specify.
80 // Defaults to GreengrassV2TokenExchangeRoleAlias.
81 #[clap(long, default_value = "GreengrassV2TokenExchangeRoleAlias")]
82 pub tes_role_alias_name: String,
83
84 // (Optional) Specify true or false. If true, then the AWS IoT Greengrass Core software sets
85 // itself up as a system service that runs when this device boots. The system service name is "
86 // greengrass.
87 // Defaults to false.
88 #[clap(long, action = clap::ArgAction::Set, default_value_t=false)]
89 pub setup_system_service: bool,
90
91 // (Optional) The name of ID of the system user and group that the AWS IoT Greengrass Core
92 // software uses to run components. This argument accepts the user and group separated by a
93 // colon, where the group is optional. For example, you can specify ggc_user:ggc_group or
94 // ggc_user.
95 // * If you run as root, this defaults to the user and group that the config file defines. If the config
96 // file doesn't define a user and group, this defaults to ggc_user:ggc_group. If ggc_user or
97 // ggc_group don't exist, the software creates them.
98 // * If you run as a non_root user, the AWS IoT Greengrass Core software uses that user to run "
99 // components.
100 // * If you don't specify a group, the AWS IoT Greengrass Core software uses the primary group
101 // of the system user
102 #[clap(long)]
103 pub component_default_user: Option<String>,
104
105 // (Optional) Specify true or false. If true, the AWS IoT Greengrass Core software retrieves and
106 // deploys the Greengrass CLI component. Specify true to set up this core
107 // device for local development. Specify false to set up this core device in a production
108 // environment. Defaults to false.
109 #[clap(long, action = clap::ArgAction::Set, default_value_t=false)]
110 pub deploy_dev_tools: bool,
111
112 // (Optional) Specify true or false. If true, the AWS IoT Greengrass Core software runs setup steps,
113 // (optional) provisions resources, and starts the software. If false, the software runs only setup
114 // steps and (optional) provisions resources. Defaults to true.
115 #[clap(long, action = clap::ArgAction::Set, default_value_t=true)]
116 pub start: bool,
117
118 // (Optional) Path of a plugin jar file. The plugin will be included as "
119 // trusted plugin in nucleus. Specify multiple times for including multiple plugins.;
120 #[clap(long)]
121 pub trusted_plugin: Option<String>,
122}