-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add database accessory and update helloworld sample
- Loading branch information
Showing
4 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
schema Database: | ||
""" Database defines the delivery artifact of relational database service | ||
(rds) provided by a specified cloud vendor for the application. | ||
|
||
Attributes | ||
---------- | ||
type: str, default is Undefined, required. | ||
Type defines the specific cloud vendor that provides the rds. | ||
engine: str, default is Undefined, required. | ||
Engine defines the database engine to use. | ||
version: str, default is Undefined, required. | ||
Version defines the database engine version to use. | ||
instanceType: str, default is Undefined, required. | ||
InstanceType defines the type of the rds instance. | ||
size: int, default is 10, optional. | ||
Size defines the allocated storage size of the rds instance in GB. | ||
category: str, default is "Basic", optional. | ||
Category defines the edition of the rds instance. | ||
username: str, default is "root", optional. | ||
Username defines the operation account for the rds instance. | ||
securityIPs: [str], default is ["0.0.0.0/0"], optional. | ||
SecurityIPs defines the list of IP addresses allowed to access the | ||
rds instance. | ||
accessInternet: bool, default is False, optional. | ||
AccessInternet defines whether the rds instance is publicly accessible. | ||
|
||
Examples | ||
-------- | ||
Instantiate a publicly accessible aws rds with mysql 5.7. | ||
|
||
import models.schema.v1.accessories.database as db | ||
|
||
database: db.Database { | ||
type: "aws" | ||
engine: "mysql" | ||
version: "5.7" | ||
instanceType: "db.t3.micro" | ||
accessInternet: True | ||
} | ||
""" | ||
|
||
# The specific cloud vendor that provides the rds. | ||
$type: str | ||
|
||
# The database engine to use. | ||
engine: str | ||
|
||
# The database engine version to use. | ||
version: str | ||
|
||
# The type of the rds instance. | ||
instanceType: str | ||
|
||
# The allocated storage size of the rds instance in GB. | ||
size?: int = 10 | ||
|
||
# The edition of the rds instance. | ||
category?: str = "Basic" | ||
|
||
# The operation account for the rds instance. | ||
username?: str = "root" | ||
|
||
# The list of IP addresses allowed to access the rds instance. | ||
securityIPs?: [str] = ["0.0.0.0/0"] | ||
|
||
# Whether the rds instance is publicly accessible. | ||
accessInternet?: bool = False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters