NAV
YAML TypeScript (CDK) Python (CDK) PHP (CDK) Java (CDK) C# (CDK)

GS2-Log

Reference to resource definitions available in GS2-Deploy templates

GS2-Deploy Reference

Entities

Namespace

Namespace

Type: GS2::Log::Namespace
Properties:
  Name: namespace1
  Description: null
  Type: gs2
  GcpCredentialJson: {"project_id": "gs2-dev"}
  BigQueryDatasetName: dataset_0001
  LogExpireDays: 3
  AwsRegion: awsRegion
  AwsAccessKeyId: awsAccessKeyId
  AwsSecretAccessKey: awsSecretAccessKey
  FirehoseStreamName: firehoseStreamName
from 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='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 Template
class 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: "gs2",
                gcpCredentialJson: "{\"project_id\": \"gs2-dev\"}",
                bigQueryDatasetName: "dataset_0001",
                logExpireDays: 3,
                awsRegion: "awsRegion",
                awsAccessKeyId: "awsAccessKeyId",
                awsSecretAccessKey: "awsSecretAccessKey",
                firehoseStreamName: "firehoseStreamName",
            ),
        );
    }
}

print((new SampleStack())->yaml());  // Generate Template
class 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() {
                {
                    type = "gs2";
                    gcpCredentialJson = "{\"project_id\": \"gs2-dev\"}";
                    bigQueryDatasetName = "dataset_0001";
                    logExpireDays = 3;
                    awsRegion = "awsRegion";
                    awsAccessKeyId = "awsAccessKeyId";
                    awsSecretAccessKey = "awsSecretAccessKey";
                    firehoseStreamName = "firehoseStreamName";
                }
            }
        );
    }
}

System.out.println(new SampleStack().yaml());  // Generate Template
import 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: "gs2",
                gcpCredentialJson: "{\"project_id\": \"gs2-dev\"}",
                bigQueryDatasetName: "dataset_0001",
                logExpireDays: 3,
                awsRegion: "awsRegion",
                awsAccessKeyId: "awsAccessKeyId",
                awsSecretAccessKey: "awsSecretAccessKey",
                firehoseStreamName: "firehoseStreamName"
            }
        );
    }
}

System.out.println(new SampleStack().yaml());  // Generate Template
public class SampleStack : Gs2Cdk.Core.Model.Stack
{
    public SampleStack() {
        new Gs2Cdk.Gs2Log.Model.Namespace(
            this,
            "namespace-0001",
            new Gs2Cdk.Gs2Log.Model.Options.NamespaceOptions {
                type = "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 Template

Namespace

Namespace is a mechanism that allows multiple uses of the same service for different purposes within a single project.
Basically, GS2 services have a layer called namespace, and different namespaces are treated as completely different data spaces, even for the same service.

Therefore, it is necessary to create a namespace before starting to use each service.

Type Require Default Limitation Description
name string ~ 32 chars Namespace name
description string ~ 1024 chars description of Namespace
type string "gs2" ~ 128 chars Log Export Method
gcpCredentialJson string {type} == "bigquery" ~ 5120 chars GCP Credentials
bigQueryDatasetName string {type} == "bigquery" ~ 1024 chars BigQuery dataset name
logExpireDays int {type} in ["gs2", "bigquery"] ~ 3650 Log retention period (days)
awsRegion string {type} == "firehose" ~ 256 chars AWS Region
awsAccessKeyId string {type} == "firehose" ~ 256 chars AWS access key ID
awsSecretAccessKey string {type} == "firehose" ~ 256 chars AWS Secret Access Key
firehoseStreamName string {type} == "firehose" ~ 256 chars Kinesis Firehose stream name