GS2-Log Deploy/CDK Reference
Entities
Resources managed by the Deploy operation
Namespace
Namespace
A Namespace allows multiple independent instances of the same service within a single project by separating data spaces and usage contexts. Each GS2 service is managed on a per-namespace basis. Even when using the same service, if the Namespace differs, the data is treated as a completely independent data space.
Therefore, you must create a Namespace before you can start using each service.
Request
Resource creation and update requests
| Type | Condition | Required | Default | Value Limits | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| name | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||||||||||
| description | string | ~ 1024 chars | Description | |||||||||||
| type | String Enum enum { “gs2”, “bigquery”, “firehose” } | “gs2” | Log Export Method Determines the destination for exported log data. “gs2” stores logs within GS2’s managed storage with built-in search and analysis capabilities. “bigquery” exports logs to Google BigQuery for advanced analytics. “firehose” streams logs to Amazon Kinesis Data Firehose for delivery to S3, Redshift, or other AWS destinations.
| |||||||||||
| gcpCredentialJson | string | {type} == “bigquery” | ✓* | ~ 5120 chars | GCP Credentials GCP credential JSON for authenticating when exporting logs to BigQuery. The service account must have BigQuery Data Editor permissions on the target dataset. * Required if type is “bigquery” | |||||||||
| bigQueryDatasetName | string | {type} == “bigquery” | ✓* | ~ 1024 chars | BigQuery Dataset Name The name of the BigQuery dataset where log data will be exported. The dataset must already exist in the GCP project associated with the provided credentials. * Required if type is “bigquery” | |||||||||
| logExpireDays | int | {type} in [“gs2”, “bigquery”] | ✓* | 0 ~ 3650 | Log Retention Period (days) The number of days to retain log data. Logs older than this period are automatically deleted. Applicable when the export method is “gs2” or “bigquery”. Maximum 3650 days (approximately 10 years). * Required if type is “gs2”,“bigquery” | |||||||||
| awsRegion | string | {type} == “firehose” | ✓* | ~ 256 chars | AWS Region The AWS region where the Kinesis Data Firehose delivery stream is located (e.g., us-east-1, ap-northeast-1). * Required if type is “firehose” | |||||||||
| awsAccessKeyId | string | {type} == “firehose” | ✓* | ~ 256 chars | AWS Access Key ID The AWS access key ID for authenticating with Kinesis Data Firehose. The IAM user must have permissions to put records to the specified Firehose delivery stream. * Required if type is “firehose” | |||||||||
| awsSecretAccessKey | string | {type} == “firehose” | ✓* | ~ 256 chars | AWS Secret Access Key The AWS secret access key paired with the access key ID for Kinesis Data Firehose authentication. * Required if type is “firehose” | |||||||||
| firehoseStreamName | string | {type} == “firehose” | ✓* | ~ 256 chars | Kinesis Firehose Stream Name The name of the Kinesis Data Firehose delivery stream to which log data is sent. * Required if type is “firehose” | |||||||||
| firehoseCompressData | String Enum enum { “none”, “gzip” } | {type} == “firehose” | “none” | Compress Data for Kinesis Firehose Whether to compress log data before sending to Kinesis Data Firehose. Gzip compression reduces data transfer volume and storage costs.
* Required if type is “firehose” |
GetAttr
Resource creation results that can be retrieved using the !GetAttr tag
| Type | Description | |
|---|---|---|
| Item | Namespace | Namespace created |
Implementation Example
Type: GS2::Log::Namespace
Properties:
Name: namespace-0001
Description: null
Type: gs2
GcpCredentialJson: {"project_id": "gs2-dev"}
BigQueryDatasetName: dataset_0001
LogExpireDays: 3
AwsRegion: awsRegion
AwsAccessKeyId: awsAccessKeyId
AwsSecretAccessKey: awsSecretAccessKey
FirehoseStreamName: firehoseStreamName
FirehoseCompressData: nullimport (
"github.com/gs2io/gs2-golang-cdk/core"
"github.com/gs2io/gs2-golang-cdk/log"
"github.com/openlyinc/pointy"
)
SampleStack := core.NewStack()
log.NewNamespace(
&SampleStack,
"namespace-0001",
log.NamespaceOptions{
Type: log.NamespaceTypeGs2,
GcpCredentialJson: pointy.String("{\"project_id\": \"gs2-dev\"}"),
BigQueryDatasetName: pointy.String("dataset_0001"),
LogExpireDays: pointy.Int32(3),
AwsRegion: pointy.String("awsRegion"),
AwsAccessKeyId: pointy.String("awsAccessKeyId"),
AwsSecretAccessKey: pointy.String("awsSecretAccessKey"),
FirehoseStreamName: pointy.String("firehoseStreamName"),
},
)
println(SampleStack.Yaml()) // Generate Templateclass SampleStack extends \Gs2Cdk\Core\Model\Stack
{
function __construct() {
parent::__construct();
new \Gs2Cdk\Log\Model\Namespace_(
stack: $this,
name: "namespace-0001",
options: new \Gs2Cdk\Log\Model\Options\NamespaceOptions(
type: \Gs2Cdk\Log\Model\Enums\NamespaceType::GS2,
gcpCredentialJson: "{\"project_id\": \"gs2-dev\"}",
bigQueryDatasetName: "dataset_0001",
logExpireDays: 3,
awsRegion: "awsRegion",
awsAccessKeyId: "awsAccessKeyId",
awsSecretAccessKey: "awsSecretAccessKey",
firehoseStreamName: "firehoseStreamName"
)
);
}
}
print((new SampleStack())->yaml()); // Generate Templateclass SampleStack extends io.gs2.cdk.core.model.Stack
{
public SampleStack() {
super();
new io.gs2.cdk.log.model.Namespace(
this,
"namespace-0001",
new io.gs2.cdk.log.model.options.NamespaceOptions()
.withType(io.gs2.cdk.log.model.enums.NamespaceType.GS2)
.withGcpCredentialJson("{\"project_id\": \"gs2-dev\"}")
.withBigQueryDatasetName("dataset_0001")
.withLogExpireDays(3)
.withAwsRegion("awsRegion")
.withAwsAccessKeyId("awsAccessKeyId")
.withAwsSecretAccessKey("awsSecretAccessKey")
.withFirehoseStreamName("firehoseStreamName")
);
}
}
System.out.println(new SampleStack().yaml()); // Generate Templatepublic class SampleStack : Gs2Cdk.Core.Model.Stack
{
public SampleStack() {
new Gs2Cdk.Gs2Log.Model.Namespace(
stack: this,
name: "namespace-0001",
options: new Gs2Cdk.Gs2Log.Model.Options.NamespaceOptions
{
type = Gs2Cdk.Gs2Log.Model.Enums.NamespaceType.Gs2,
gcpCredentialJson = "{\"project_id\": \"gs2-dev\"}",
bigQueryDatasetName = "dataset_0001",
logExpireDays = 3,
awsRegion = "awsRegion",
awsAccessKeyId = "awsAccessKeyId",
awsSecretAccessKey = "awsSecretAccessKey",
firehoseStreamName = "firehoseStreamName"
}
);
}
}
Debug.Log(new SampleStack().Yaml()); // Generate Templateimport core from "@/gs2cdk/core";
import log from "@/gs2cdk/log";
class SampleStack extends core.Stack
{
public constructor() {
super();
new log.model.Namespace(
this,
"namespace-0001",
{
type: log.model.NamespaceType.GS2,
gcpCredentialJson: "{\"project_id\": \"gs2-dev\"}",
bigQueryDatasetName: "dataset_0001",
logExpireDays: 3,
awsRegion: "awsRegion",
awsAccessKeyId: "awsAccessKeyId",
awsSecretAccessKey: "awsSecretAccessKey",
firehoseStreamName: "firehoseStreamName"
}
);
}
}
console.log(new SampleStack().yaml()); // Generate Templatefrom gs2_cdk import Stack, core, log
class SampleStack(Stack):
def __init__(self):
super().__init__()
log.Namespace(
stack=self,
name='namespace-0001',
options=log.NamespaceOptions(
type=log.NamespaceType.GS2,
gcp_credential_json='{"project_id": "gs2-dev"}',
big_query_dataset_name='dataset_0001',
log_expire_days=3,
aws_region='awsRegion',
aws_access_key_id='awsAccessKeyId',
aws_secret_access_key='awsSecretAccessKey',
firehose_stream_name='firehoseStreamName',
),
)
print(SampleStack().yaml()) # Generate TemplateDashboard
Dashboard
A customizable dashboard for visualizing log data and metrics. Each dashboard stores its layout and widget configuration as a JSON payload, allowing users to create tailored views of their log analytics.
Request
Resource creation and update requests
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| displayName | string | ✓ | ~ 256 chars | Display Name A human-readable name for this dashboard, shown in the dashboard list and header. | ||
| description | string | ~ 1024 chars | Description |
GetAttr
Resource creation results that can be retrieved using the !GetAttr tag
| Type | Description | |
|---|---|---|
| Item | Dashboard | Created Dashboard |
Implementation Example
Type: GS2::Log::Dashboard
Properties:
NamespaceName: namespace-0001
DisplayName: Sample Dashboard 0001
Description: nullimport (
"github.com/gs2io/gs2-golang-cdk/core"
"github.com/gs2io/gs2-golang-cdk/log"
)
SampleStack := core.NewStack()
log.NewDashboard(
&SampleStack,
"namespace-0001",
"Sample Dashboard 0001",
log.DashboardOptions{},
)
println(SampleStack.Yaml()) // Generate Templateclass SampleStack extends \Gs2Cdk\Core\Model\Stack
{
function __construct() {
parent::__construct();
new \Gs2Cdk\Log\Model\Dashboard(
stack: $this,
namespaceName: "namespace-0001",
displayName: "Sample Dashboard 0001"
);
}
}
print((new SampleStack())->yaml()); // Generate Templateclass SampleStack extends io.gs2.cdk.core.model.Stack
{
public SampleStack() {
super();
new io.gs2.cdk.log.model.Dashboard(
this,
"namespace-0001",
"Sample Dashboard 0001"
);
}
}
System.out.println(new SampleStack().yaml()); // Generate Templatepublic class SampleStack : Gs2Cdk.Core.Model.Stack
{
public SampleStack() {
new Gs2Cdk.Gs2Log.Model.Dashboard(
stack: this,
namespaceName: "namespace-0001",
displayName: "Sample Dashboard 0001"
);
}
}
Debug.Log(new SampleStack().Yaml()); // Generate Templateimport core from "@/gs2cdk/core";
import log from "@/gs2cdk/log";
class SampleStack extends core.Stack
{
public constructor() {
super();
new log.model.Dashboard(
this,
"namespace-0001",
"Sample Dashboard 0001"
);
}
}
console.log(new SampleStack().yaml()); // Generate Templatefrom gs2_cdk import Stack, core, log
class SampleStack(Stack):
def __init__(self):
super().__init__()
log.Dashboard(
stack=self,
namespace_name='namespace-0001',
display_name='Sample Dashboard 0001',
)
print(SampleStack().yaml()) # Generate TemplateFacetModel
Facet Model
Defines a facet field available for filtering and aggregating log data. Facets allow users to narrow down log search results by specific dimensions such as service name, method, status, or custom fields.
Request
Resource creation and update requests
| Type | Condition | Required | Default | Value Limits | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||||||||||
| field | string | ✓ | ~ 128 chars | Facet Field Name The name of the log field that this facet operates on (e.g., “service”, “method”, “status”). | ||||||||||
| type | String Enum enum { “string”, “double”, “measure” } | ✓ | Facet Data Type The data type of the facet field. “string” for categorical values with value counts, “double” for numeric values with range filtering, “measure” for measurement values with statistical analysis.
| |||||||||||
| displayName | string | ✓ | ~ 128 chars | Display Name A human-readable name for this facet, shown in the log search UI. | ||||||||||
| order | int | 0 | 0 ~ 100000 | Display Order The sort order for displaying this facet in the UI. Lower values appear first. |
GetAttr
Resource creation results that can be retrieved using the !GetAttr tag
| Type | Description | |
|---|---|---|
| Item | FacetModel | Created Facet Model |
Implementation Example
Type: GS2::Log::FacetModel
Properties:
NamespaceName: namespace-0001
Field: facet-model-0001
Type: string
DisplayName: Sample Facet Model 0001
Order: nullimport (
"github.com/gs2io/gs2-golang-cdk/core"
"github.com/gs2io/gs2-golang-cdk/log"
)
SampleStack := core.NewStack()
log.NewFacetModel(
&SampleStack,
"namespace-0001",
"facet-model-0001",
log.FacetModelTypeString,
"Sample Facet Model 0001",
log.FacetModelOptions{},
)
println(SampleStack.Yaml()) // Generate Templateclass SampleStack extends \Gs2Cdk\Core\Model\Stack
{
function __construct() {
parent::__construct();
new \Gs2Cdk\Log\Model\FacetModel(
stack: $this,
namespaceName: "namespace-0001",
field: "facet-model-0001",
type: \Gs2Cdk\Log\Model\Enums\FacetModelType::STRING,
displayName: "Sample Facet Model 0001"
);
}
}
print((new SampleStack())->yaml()); // Generate Templateclass SampleStack extends io.gs2.cdk.core.model.Stack
{
public SampleStack() {
super();
new io.gs2.cdk.log.model.FacetModel(
this,
"namespace-0001",
"facet-model-0001",
io.gs2.cdk.log.model.enums.FacetModelType.STRING,
"Sample Facet Model 0001"
);
}
}
System.out.println(new SampleStack().yaml()); // Generate Templatepublic class SampleStack : Gs2Cdk.Core.Model.Stack
{
public SampleStack() {
new Gs2Cdk.Gs2Log.Model.FacetModel(
stack: this,
namespaceName: "namespace-0001",
field: "facet-model-0001",
type: Gs2Cdk.Gs2Log.Model.Enums.FacetModelType.String,
displayName: "Sample Facet Model 0001"
);
}
}
Debug.Log(new SampleStack().Yaml()); // Generate Templateimport core from "@/gs2cdk/core";
import log from "@/gs2cdk/log";
class SampleStack extends core.Stack
{
public constructor() {
super();
new log.model.FacetModel(
this,
"namespace-0001",
"facet-model-0001",
log.model.FacetModelType.STRING,
"Sample Facet Model 0001"
);
}
}
console.log(new SampleStack().yaml()); // Generate Templatefrom gs2_cdk import Stack, core, log
class SampleStack(Stack):
def __init__(self):
super().__init__()
log.FacetModel(
stack=self,
namespace_name='namespace-0001',
field='facet-model-0001',
type=log.FacetModelType.STRING,
display_name='Sample Facet Model 0001',
)
print(SampleStack().yaml()) # Generate Template