示例#1
0
func ExampleConfigService_DescribeComplianceByConfigRule() {
	svc := configservice.New(session.New())

	params := &configservice.DescribeComplianceByConfigRuleInput{
		ComplianceTypes: []*string{
			aws.String("ComplianceType"), // Required
			// More values...
		},
		ConfigRuleNames: []*string{
			aws.String("StringWithCharLimit64"), // Required
			// More values...
		},
		NextToken: aws.String("String"),
	}
	resp, err := svc.DescribeComplianceByConfigRule(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
示例#2
0
func ExampleConfigService_PutDeliveryChannel() {
	svc := configservice.New(session.New())

	params := &configservice.PutDeliveryChannelInput{
		DeliveryChannel: &configservice.DeliveryChannel{ // Required
			ConfigSnapshotDeliveryProperties: &configservice.ConfigSnapshotDeliveryProperties{
				DeliveryFrequency: aws.String("MaximumExecutionFrequency"),
			},
			Name:         aws.String("ChannelName"),
			S3BucketName: aws.String("String"),
			S3KeyPrefix:  aws.String("String"),
			SnsTopicARN:  aws.String("String"),
		},
	}
	resp, err := svc.PutDeliveryChannel(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
示例#3
0
func ExampleConfigService_PutEvaluations() {
	svc := configservice.New(session.New())

	params := &configservice.PutEvaluationsInput{
		ResultToken: aws.String("String"), // Required
		Evaluations: []*configservice.Evaluation{
			{ // Required
				ComplianceResourceId:   aws.String("StringWithCharLimit256"), // Required
				ComplianceResourceType: aws.String("StringWithCharLimit256"), // Required
				ComplianceType:         aws.String("ComplianceType"),         // Required
				OrderingTimestamp:      aws.Time(time.Now()),                 // Required
				Annotation:             aws.String("StringWithCharLimit256"),
			},
			// More values...
		},
	}
	resp, err := svc.PutEvaluations(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
示例#4
0
func ExampleConfigService_ListDiscoveredResources() {
	svc := configservice.New(session.New())

	params := &configservice.ListDiscoveredResourcesInput{
		ResourceType:            aws.String("ResourceType"), // Required
		IncludeDeletedResources: aws.Bool(true),
		Limit:     aws.Int64(1),
		NextToken: aws.String("NextToken"),
		ResourceIds: []*string{
			aws.String("ResourceId"), // Required
			// More values...
		},
		ResourceName: aws.String("ResourceName"),
	}
	resp, err := svc.ListDiscoveredResources(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
示例#5
0
func ExampleConfigService_PutConfigurationRecorder() {
	svc := configservice.New(session.New())

	params := &configservice.PutConfigurationRecorderInput{
		ConfigurationRecorder: &configservice.ConfigurationRecorder{ // Required
			Name: aws.String("RecorderName"),
			RecordingGroup: &configservice.RecordingGroup{
				AllSupported:               aws.Bool(true),
				IncludeGlobalResourceTypes: aws.Bool(true),
				ResourceTypes: []*string{
					aws.String("ResourceType"), // Required
					// More values...
				},
			},
			RoleARN: aws.String("String"),
		},
	}
	resp, err := svc.PutConfigurationRecorder(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
示例#6
0
func ExampleConfigService_GetComplianceSummaryByConfigRule() {
	svc := configservice.New(session.New())

	var params *configservice.GetComplianceSummaryByConfigRuleInput
	resp, err := svc.GetComplianceSummaryByConfigRule(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
示例#7
0
func ExampleConfigService_PutConfigRule() {
	svc := configservice.New(session.New())

	params := &configservice.PutConfigRuleInput{
		ConfigRule: &configservice.ConfigRule{ // Required
			Source: &configservice.Source{ // Required
				Owner: aws.String("Owner"),
				SourceDetails: []*configservice.SourceDetail{
					{ // Required
						EventSource: aws.String("EventSource"),
						MessageType: aws.String("MessageType"),
					},
					// More values...
				},
				SourceIdentifier: aws.String("StringWithCharLimit256"),
			},
			ConfigRuleArn:             aws.String("String"),
			ConfigRuleId:              aws.String("String"),
			ConfigRuleName:            aws.String("StringWithCharLimit64"),
			ConfigRuleState:           aws.String("ConfigRuleState"),
			Description:               aws.String("EmptiableStringWithCharLimit256"),
			InputParameters:           aws.String("StringWithCharLimit256"),
			MaximumExecutionFrequency: aws.String("MaximumExecutionFrequency"),
			Scope: &configservice.Scope{
				ComplianceResourceId: aws.String("StringWithCharLimit256"),
				ComplianceResourceTypes: []*string{
					aws.String("StringWithCharLimit256"), // Required
					// More values...
				},
				TagKey:   aws.String("StringWithCharLimit128"),
				TagValue: aws.String("StringWithCharLimit256"),
			},
		},
	}
	resp, err := svc.PutConfigRule(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
示例#8
0
func ExampleConfigService_StopConfigurationRecorder() {
	svc := configservice.New(session.New())

	params := &configservice.StopConfigurationRecorderInput{
		ConfigurationRecorderName: aws.String("RecorderName"), // Required
	}
	resp, err := svc.StopConfigurationRecorder(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
示例#9
0
func ExampleConfigService_DeliverConfigSnapshot() {
	svc := configservice.New(session.New())

	params := &configservice.DeliverConfigSnapshotInput{
		DeliveryChannelName: aws.String("ChannelName"), // Required
	}
	resp, err := svc.DeliverConfigSnapshot(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
示例#10
0
func ExampleConfigService_DeleteConfigRule() {
	svc := configservice.New(session.New())

	params := &configservice.DeleteConfigRuleInput{
		ConfigRuleName: aws.String("StringWithCharLimit64"), // Required
	}
	resp, err := svc.DeleteConfigRule(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
示例#11
0
func ExampleConfigService_GetComplianceSummaryByResourceType() {
	svc := configservice.New(session.New())

	params := &configservice.GetComplianceSummaryByResourceTypeInput{
		ResourceTypes: []*string{
			aws.String("StringWithCharLimit256"), // Required
			// More values...
		},
	}
	resp, err := svc.GetComplianceSummaryByResourceType(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
示例#12
0
func ExampleConfigService_DescribeDeliveryChannels() {
	svc := configservice.New(session.New())

	params := &configservice.DescribeDeliveryChannelsInput{
		DeliveryChannelNames: []*string{
			aws.String("ChannelName"), // Required
			// More values...
		},
	}
	resp, err := svc.DescribeDeliveryChannels(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
示例#13
0
func ExampleConfigService_GetResourceConfigHistory() {
	svc := configservice.New(session.New())

	params := &configservice.GetResourceConfigHistoryInput{
		ResourceId:         aws.String("ResourceId"),   // Required
		ResourceType:       aws.String("ResourceType"), // Required
		ChronologicalOrder: aws.String("ChronologicalOrder"),
		EarlierTime:        aws.Time(time.Now()),
		LaterTime:          aws.Time(time.Now()),
		Limit:              aws.Int64(1),
		NextToken:          aws.String("NextToken"),
	}
	resp, err := svc.GetResourceConfigHistory(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
示例#14
0
func init() {
	Before("@configservice", func() {
		World["client"] = configservice.New(smoke.Session)
	})
}