Doc AWS SDK 예제 GitHub 리포지토리에서 더 많은 SDK 예제를 사용할 수 있습니다. AWS
기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.
AWS SDK 또는 CLI와 CreateDBParameterGroup 함께 사용
다음 코드 예시는 CreateDBParameterGroup의 사용 방법을 보여 줍니다.
작업 예제는 대규모 프로그램에서 발췌한 코드이며 컨텍스트에 맞춰 실행해야 합니다. 다음 코드 예제에서는 컨텍스트 내에서 이 작업을 확인할 수 있습니다.
- .NET
- 
            - SDK for .NET
- 
참고GitHub에 더 많은 내용이 있습니다. AWS 코드 예 리포지토리 에서 전체 예를 찾고 설정 및 실행하는 방법을 배워보세요. /// <summary> /// Create a new DB parameter group. Use the action DescribeDBParameterGroupsAsync /// to determine when the DB parameter group is ready to use. /// </summary> /// <param name="name">Name of the DB parameter group.</param> /// <param name="family">Family of the DB parameter group.</param> /// <param name="description">Description of the DB parameter group.</param> /// <returns>The new DB parameter group.</returns> public async Task<DBParameterGroup> CreateDBParameterGroup( string name, string family, string description) { var response = await _amazonRDS.CreateDBParameterGroupAsync( new CreateDBParameterGroupRequest() { DBParameterGroupName = name, DBParameterGroupFamily = family, Description = description }); return response.DBParameterGroup; }- 
                    API 세부 정보는 AWS SDK for .NET API 참조의 CreateDBParameterGroup을 참조하십시오. 
 
- 
                    
 
- C++
- 
            - SDK for C++
- 
참고GitHub에 더 많은 내용이 있습니다. AWS 코드 예 리포지토리 에서 전체 예를 찾고 설정 및 실행하는 방법을 배워보세요. Aws::Client::ClientConfiguration clientConfig; // Optional: Set to the AWS Region (overrides config file). // clientConfig.region = "us-east-1"; Aws::RDS::RDSClient client(clientConfig); Aws::RDS::Model::CreateDBParameterGroupRequest request; request.SetDBParameterGroupName(PARAMETER_GROUP_NAME); request.SetDBParameterGroupFamily(dbParameterGroupFamily); request.SetDescription("Example parameter group."); Aws::RDS::Model::CreateDBParameterGroupOutcome outcome = client.CreateDBParameterGroup(request); if (outcome.IsSuccess()) { std::cout << "The DB parameter group was successfully created." << std::endl; } else { std::cerr << "Error with RDS::CreateDBParameterGroup. " << outcome.GetError().GetMessage() << std::endl; return false; }- 
                    API 세부 정보는 AWS SDK for C++ API 참조의 CreateDBParameterGroup을 참조하십시오. 
 
- 
                    
 
- CLI
- 
            - AWS CLI
- 
             
                    DB 파라미터 그룹을 생성하려면 다음 create-db-parameter-group예시에서는 DB 파라미터 그룹을 생성합니다.aws rds create-db-parameter-group \ --db-parameter-group-namemydbparametergroup\ --db-parameter-group-familyMySQL5.6\ --description"My new parameter group"출력: { "DBParameterGroup": { "DBParameterGroupName": "mydbparametergroup", "DBParameterGroupFamily": "mysql5.6", "Description": "My new parameter group", "DBParameterGroupArn": "arn:aws:rds:us-east-1:123456789012:pg:mydbparametergroup" } }자세한 내용은 Amazon RDS 사용자 안내서의 DB 파라미터 그룹 생성을 참조하세요. - 
                    API 세부 정보는 AWS CLI 명령 참조의 CreateDBParameterGroup 을 참조하세요. 
 
- 
                    
 
- Go
- 
            - SDK for Go V2
- 
참고GitHub에 더 많은 내용이 있습니다. AWS 코드 예 리포지토리 에서 전체 예를 찾고 설정 및 실행하는 방법을 배워보세요. import ( "context" "errors" "log" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/rds" "github.com/aws/aws-sdk-go-v2/service/rds/types" ) type DbInstances struct { RdsClient *rds.Client } // CreateParameterGroup creates a DB parameter group that is based on the specified // parameter group family. func (instances *DbInstances) CreateParameterGroup( ctx context.Context, parameterGroupName string, parameterGroupFamily string, description string) ( *types.DBParameterGroup, error) { output, err := instances.RdsClient.CreateDBParameterGroup(ctx, &rds.CreateDBParameterGroupInput{ DBParameterGroupName: aws.String(parameterGroupName), DBParameterGroupFamily: aws.String(parameterGroupFamily), Description: aws.String(description), }) if err != nil { log.Printf("Couldn't create parameter group %v: %v\n", parameterGroupName, err) return nil, err } else { return output.DBParameterGroup, err } }- 
                    API 세부 정보는 AWS SDK for Go API 참조의 CreateDBParameterGroup 을 참조하십시오. 
 
- 
                    
 
- Java
- 
            - SDK for Java 2.x
- 
참고GitHub에 더 많은 내용이 있습니다. AWS 코드 예 리포지토리 에서 전체 예를 찾고 설정 및 실행하는 방법을 배워보세요. public static void createDBParameterGroup(RdsClient rdsClient, String dbGroupName, String dbParameterGroupFamily) { try { CreateDbParameterGroupRequest groupRequest = CreateDbParameterGroupRequest.builder() .dbParameterGroupName(dbGroupName) .dbParameterGroupFamily(dbParameterGroupFamily) .description("Created by using the AWS SDK for Java") .build(); CreateDbParameterGroupResponse response = rdsClient.createDBParameterGroup(groupRequest); System.out.println("The group name is " + response.dbParameterGroup().dbParameterGroupName()); } catch (RdsException e) { System.out.println(e.getLocalizedMessage()); System.exit(1); } }- 
                    API 세부 정보는 AWS SDK for Java 2.x API 참조의 CreateDBParameterGroup을 참조하십시오. 
 
- 
                    
 
- Python
- 
            - SDK for Python (Boto3)
- 
참고GitHub에 더 많은 내용이 있습니다. AWS 코드 예 리포지토리 에서 전체 예를 찾고 설정 및 실행하는 방법을 배워보세요. class InstanceWrapper: """Encapsulates Amazon RDS DB instance actions.""" def __init__(self, rds_client): """ :param rds_client: A Boto3 Amazon RDS client. """ self.rds_client = rds_client @classmethod def from_client(cls): """ Instantiates this class from a Boto3 client. """ rds_client = boto3.client("rds") return cls(rds_client) def create_parameter_group( self, parameter_group_name, parameter_group_family, description ): """ Creates a DB parameter group that is based on the specified parameter group family. :param parameter_group_name: The name of the newly created parameter group. :param parameter_group_family: The family that is used as the basis of the new parameter group. :param description: A description given to the parameter group. :return: Data about the newly created parameter group. """ try: response = self.rds_client.create_db_parameter_group( DBParameterGroupName=parameter_group_name, DBParameterGroupFamily=parameter_group_family, Description=description, ) except ClientError as err: logger.error( "Couldn't create parameter group %s. Here's why: %s: %s", parameter_group_name, err.response["Error"]["Code"], err.response["Error"]["Message"], ) raise else: return response- 
                    API 세부 정보는 AWS SDK for Python (Boto3) API 참조의 CreateDBParameterGroup를 참조하십시오. 
 
- 
                    
 
- Swift
- 
            - SDK for Swift
- 
참고GitHub에 더 많은 내용이 있습니다. AWS 코드 예 리포지토리 에서 전체 예를 찾고 설정 및 실행하는 방법을 배워보세요. import AWSRDS /// Create a new database parameter group with the specified name. /// /// - Parameters: /// - groupName: The name of the new parameter group. /// - familyName: The name of the parameter group family. /// - Returns: func createDBParameterGroup(groupName: String, familyName: String) async -> RDSClientTypes.DBParameterGroup? { do { let output = try await rdsClient.createDBParameterGroup( input: CreateDBParameterGroupInput( dbParameterGroupFamily: familyName, dbParameterGroupName: groupName, description: "Created using the AWS SDK for Swift" ) ) return output.dbParameterGroup } catch { print("*** Error creating the parameter group: \(error.localizedDescription)") return nil } }- 
                    API 세부 정보는 AWS SDK for Swift API 참조의 CreateDBParameterGroup 을 참조하세요. 
 
-